how to save for loop results

Hello everyone Gud evening and happy new yr i m giving one matlab program below
n=5
for i=1:n
a=magic(i)
end
i want to modify this program such that all the 5 resulting matrices are saved and accessed by name
a1= magic 1 matix
a2= magic 2 matix
a3= magic 3 matix
a4= magic 4 matix
a5= magic 5 matix
would anybody please help me?

Antworten (2)

Walter Roberson
Walter Roberson am 3 Jan. 2013

0 Stimmen

2 Kommentare

vijay
vijay am 3 Jan. 2013
thank u very much sir. bt i havnt got the solution from the link given by you.
José-Luis
José-Luis am 3 Jan. 2013
What did you try or which part did you not understand?

Melden Sie sich an, um zu kommentieren.

Hello kity
Hello kity am 3 Jan. 2013
Bearbeitet: Hello kity am 3 Jan. 2013

0 Stimmen

Creat cell array/ or normal matrix
n=5
a=cell(1,5)
for i=1:n
a{i}=magic(i)
end

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 3 Jan. 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by