producing syms

hi I`m saeed I want to write a script that ask me the n (number) and then produce sym n characters respectively like x1 x2 x3 x3 ... thanks

回答 (1 件)

Oleg Komarov
Oleg Komarov 2011 年 8 月 1 日

0 投票

Use inputdlg to ask for n, then:
% Create names X1,...,Xn
vars = arrayfun(@(v) sprintf('x%d',v),1:n,'un',0);
% Create syms
syms(vars{:})

タグ

質問済み:

2011 年 8 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by