It is possible to use sprintf to print a string input?
10 次查看(过去 30 天)
显示 更早的评论
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');
c1= sprintf('Indicate the units of the variable %0.0s',vi);
vi_u=input(c1);
3 个评论
采纳的回答
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);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Install Products 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!