How to save function outputs as a vector to workspace.
古いコメントを表示
function [A B] = coconuts( a, b, c)
the function will run many times, each time outputting a unique A & B. How can I save each A & B output into a corresponding (N,1) vector that is available in the workspace?
Thank you.
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2014 年 7 月 30 日
for k=1:N
[A(k) B(k)] = coconuts( a, b, c);
end
1 件のコメント
Ikenna Okoye
2018 年 8 月 31 日
It works nicely, but is there a way to increment the k=1:N? I wrote a code for an atmospheric model and I need to plot the output of the function and I'm varying it from 1km to 100km by 1km increments. I would appreciate your help!
カテゴリ
ヘルプ センター および File Exchange で Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!