且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在一行中使用`textscan`函数的多个输出?

更新时间:2023-11-22 13:41:46

您将需要两行来完成所需的操作.首先,将所需的值转换为虚拟变量,然后使用deal分配数据:

You'll need two lines to do what you want. First you get the desired valued into a dummy variable, then distribute the data with deal:

dummy = textscan(s, '%s %f %f %f');
[a,b,c,d] = deal(dummy {:});