sinat_22822467 2015-09-21 09:45 采纳率: 16.7%
浏览 3404
已结题

急求大神帮忙啊!matlab中遇到的矩阵变量问题

v=[ ];x=[ ];a=[ ];
f=[ ];g=[ ];b=[ ];w=[ ];u=[ ];gg0=[ ];可以在matlab2013中这样编辑动态的数组变量吗?为什么会出现以下错误呢
The size of the indicated variable or array appears to be changing with each loop iteration. Commonly, this message appears because an array is growing by assignment or concatenation. Growing an array by assignment or concatenation can be expensive. For large arrays, MATLAB must allocate a new block of memory and copy the older array contents to the new array as it makes each assignment. Programs that change a variable's size in this way can spend most of their run time in this inefficient activity.
翻译为:显示变量或数组的大小与每个循环迭代似乎正在改变。一般,这个消息似乎因为增加数组赋值或连接。增长数组赋值或连接可以是昂贵的。对于大型阵列,MATLAB必须分配一个新的块内存和年长的数组内容复制到新数组,因为它使每个任务。程序,以这种方式改变一个变量的大小可以花大部分运行时间在这种低效率的活动。

  • 写回答

2条回答

  • _cycycyc 2015-09-21 12:23
    关注

    这个应该是warning吧,可以这么写只不过可能效率低一点,因为动态增长数组可能会需要重新分配内存。

    评论

报告相同问题?

悬赏问题

  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题
  • ¥15 Python时间序列如何拟合疏系数模型
  • ¥15 求学软件的前人们指明方向🥺
  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接