how to save calculating result ( form two variable) in 2-D matrix ?
Ältere Kommentare anzeigen
let's me explaining my question :
for example in 1-D
using for loop:
z=[ ];
for Eg=.5:.05:1.3;
a = quad(@(x) (x.^2)./(exp(x/0.516)-1) , Eg , 100 );
z = [z a]
end
then i use "arrayfun" saving result in 1-D matrix
z=[ ];
Eg=0.5:0.05:1.3;
a = arrayfun(@(x1)quad(@(x)x.^2./(exp(x/0.516)-1),x1,100),Eg)
Now i want to this process with 2 variables change to 2-d matrix that Eg is on row and Ei is on column.
(here is my code)
z=[ ];
for Eg=.5:.05:1.3;
for Ei=0:0.05:Eg-0.05
aa= quad( @(E)(E.^2) ./ (exp(E./0.5172)-1), Ei , Eg);
z = [z a]
end
end
thanks :)
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!