在Matlab中创建多维数组 [英] create a multidimensional array in matlab

查看:241
本文介绍了在Matlab中创建多维数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在matlab中创建一个多维数组,该数组具有三个参数,数字,宽度和高度

i am creating a multidimensional array in matlab which has three paramter , number , width and height

A = randn(number,width,height)

我的问题是数字是动态变量,当它在文本文件中找到对象时会增加.我应该如何使数字变量动态化,

My problem is number is dynamic variable which increase when it find objects in the text file. How i am suppose to make the number variable dynamic,

我尝试过,但是没有用

A = randn(:,width,height)

推荐答案

i = 0;
when (object in text file)
i = i+1;
A(i,:,:) = data;
end

数据的大小-width x height

这篇关于在Matlab中创建多维数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆