While Generating Elements While Creating a Matrix, the following happened.....
Mostra commenti meno recenti
While Generating Elements While Creating a Matrix, the following happened.....
>> A = sym('A', [2 4]) ??? Error using ==> error Formatted arguments cannot be non-scalar numeric matrices.
Error in ==> sym.sym at 100 error('symbolic:sym:sym:errmsg4','Second argument %s not recognized.',a);
Help required...
Risposte (2)
Walter Roberson
il 22 Giu 2011
0 voti
Which MATLAB version are you using? The ability to specify a size matrix in sym() is quite new, R2010b I think it is; with older MATLAB releases the error message for trying it might be strange.
2 Commenti
Sukhmeet
il 22 Giu 2011
Walter Roberson
il 22 Giu 2011
That version is definitely too early to create a symbolic matrix using that syntax.
Sean's answer is good if you want to create A as an array initialized to particular values. If you want to create an array of symbols, there are ways involving loops or expressions with meshgrid()
Sean de Wolski
il 22 Giu 2011
A = sym(zeros(2,4)) %?
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!