将变量从工作空间保存到结构中

时间:2017-04-05 07:44:54

标签: matlab matlab-struct

enter image description here

如图所示,我有三个变量,两个名为number_of_steps_...,第三个名为struct

如何将number_of_steps变量中保存的内容保存到struct

我尝试过save命令,但这并不能满足我的需求。这样做的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

我不知道“保存”是什么意思,但您可以使用

将它们添加到结构中
save mystruct.mat mystruct

然后使用

将结构保存到文件中
struct

注意我已经冒昧地将变量mystruct重命名为Request request = new Request.Builder() .url(url) .addHeader("range", String.format("bytes=%s", TextUtils.join(", ", ranges))) .build(); Response response = client.newCall(request).execute(); ByteArrayDataSource dataSource = new ByteArrayDataSource(response.body().byteStream(), response.body().contentType().toString()); MimeMultipart multipart = new MimeMultipart(dataSource); int count = multipart.getCount(); for (int i = 0; i < count; i++) { BodyPart bodyPart = multipart.getBodyPart(i); if (bodyPart.isMimeType("application/octet-stream")) { processBinaryStream(bodyPart.getInputStream()); } else { // Or process different types of data throw new Exception(String.format("Content type: %s cannot be parsed", bodyPart.getContentType())); } } 。从"struct" is a Matlab command开始,将它用作变量名称并不是一个好主意。

相关问题