How can I get values for f in a matrix of dimension(100,1)?
1 view (last 30 days)
Show older comments
for x=linspace(-1,1,10)
for y=linspace(-1,1,10)
f= (1-x).^2 +100*(y-x.^2).^2
end
end
0 Comments
Answers (2)
Jan
on 18 Sep 2017
Since R2016b with auto-expanding:
x = linspace(-1,1,10);
y = linspace(-1,1,10).';
f = (1-x).^2 + 100*(y - x.^2).^2;
f = f(:)
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!