Saving previous values in a function to use them within it

62 ビュー (過去 30 日間)
John Doe
John Doe 2020 年 5 月 26 日
コメント済み: John Doe 2020 年 5 月 27 日
Hi everyone,
This is a silly question but I don't know what I'm doing wrong.
I have a function that I'm running through a loop, within this function I need it to store a previous value because at a specific condition the code would require it.
for example
function [XX] = myfunction(Name,i)
Value{i} = yy
Now this function goes through a loop and as my i values increase I'd call for Value{i-1} at some point but it's not saving the previous values.
I feel like it's a simple thing but I don't know what it is.


Stephen23 2020 年 5 月 26 日
  1 件のコメント
John Doe
John Doe 2020 年 5 月 27 日
Thank you!


その他の回答 (0 件)


Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by