save all value array in loop for
1 次查看(过去 30 天)
显示 更早的评论
Can you help me how to save all value under array form in for loop.. with @myfun is function 2 variable, and I put variable_1 = X(1) ; variable_2 = X(2)
So result of X showed: for example 2.123 5.245
Mycode below:
N=10;
valueOfX = zeros(1,N);
for i=1:N
Pnet= 100+50*i;
x0=[10,10];
options=optimoptions('fsolve','Display','iter');
X=fsolve(@myfun,x0,options);
valueOfX(i)=X;
disp(valueOfX(i)/0.3048);
end
2 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!