How do I generate a string during a loop

2 ビュー (過去 30 日間)
Kevin  Hartman
Kevin Hartman 2017 年 11 月 1 日
コメント済み: Kevin Hartman 2017 年 11 月 2 日
I'm looking to generate a string, such as 'grape', when a certain value, say, 0.5, is encountered during a loop. How do I do this?
  3 件のコメント
Eric
Eric 2017 年 11 月 2 日
if value==0.5
'grape'
end
If you want to actually do something with it, save it in a variable. Not sure what you want to do with the 'grape' string.
Kevin  Hartman
Kevin Hartman 2017 年 11 月 2 日
Thank you, this will work.

サインインしてコメントする。

回答 (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