when char(65) then A.
5 次查看(过去 30 天)
显示 更早的评论
but when we define A='5', then char(5) can not be the result A. how can we get this value?
0 个评论
回答(2 个)
Star Strider
2015-4-17
You have defined ‘A’ as a string, so it will remain so. If you want to find the numeric value (5) you assigned to ‘A’, you would have to use the str2num or similar funcitons:
A = '5';
a = str2num(A)
produces:
a =
5.0000e+000
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!