Matlab的 - 串('321')转化为[3,2,1] [英] Matlab - converting the string ('321') to [3,2,1]
本文介绍了Matlab的 - 串('321')转化为[3,2,1]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
字符串转换为数字数组在MATLAB
我是一个新的Matlab的用户。我想知道如何进行上述操作。我完全难住了。
I am a new Matlab user. I would like to know how to perform the above. I am completely stumped.
您的时间和帮助是很大的AP preciated,先谢谢了。
Your time and help is greatly appreciated, thanks in advance.
推荐答案
在MatLab的字符串就是字符数组。
A string in MatLab is just an array of characters.
您可以减去 0
离开每个数字的值。
You can subtract '0'
to leave the value of each digit.
> '321' - '0'
ans =
3 2 1
这篇关于Matlab的 - 串('321')转化为[3,2,1]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文