convert string to double
Ältere Kommentare anzeigen
If I have a string like : `A = cos(2*pi*f1*t) + 4*sin(2*pi*f2*t)`
How I can convert it to double ?
I tried
B = str2num(A) % I obtain an empty matrix
or
B = str2double(A) % I obtain a Nan response...
How can I fixe it ?
1 Kommentar
Jos (10584)
am 12 Dez. 2017
What do you expect to get? Do you want to evaluate the formula?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!