フィルターのクリア

It is possible to use sprintf to print a string input?

5 ビュー (過去 30 日間)
Madalena Francisco
Madalena Francisco 2023 年 1 月 15 日
コメント済み: Madalena Francisco 2023 年 1 月 15 日
Hi, I´m trying to print what the user inputs as a string, but it´s not working with this code below:
Thanks!!
clc, clear, close
vi=input('Indicate the name of the independent variable: ','s');
Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering.
c1= sprintf('Indicate the units of the variable %0.0s',vi);
vi_u=input(c1);
  3 件のコメント
Madalena Francisco
Madalena Francisco 2023 年 1 月 15 日
Hi! I don´t use the online version, but when I run the code here it appears that message that you can see on the code i provide:
Unable to run the 'fevalJSON' function because it calls the 'input' function, which is not supported for this product offering
here it´s my code without that:
clc, clear, close
vi=input('Indicate the name of the independent variable: ','s');
c1= sprintf('Indicate the units of the variable %0.0s',vi);
vi_u=input(c1);
Madalena Francisco
Madalena Francisco 2023 年 1 月 15 日
The the cyclist, already help me with this! Thanks a lot anyways!

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

採用された回答

the cyclist
the cyclist 2023 年 1 月 15 日
I think you want
c1= sprintf('Indicate the units of the variable %s',vi);
rather than
c1= sprintf('Indicate the units of the variable %0.0s',vi);
  1 件のコメント
Madalena Francisco
Madalena Francisco 2023 年 1 月 15 日
Hello!! Thank u so much it works it works <3

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTroubleshooting in MATLAB Compiler SDK についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by