Conversion to double from cell is not possible.
2016-05-18 10:21
330 查看
出处:http://cn.mathworks.com/matlabcentral/answers/25332-conversion-to-double-from-cell-is-not-possible
以下代码:
ne_style = { '-r', '-g', '-c', '-xk', '-hm', '-b' };
for i= 1: length(line_style)
end
%说明:每一次使用plot都使用新的线型。
出现错误: Error using ==> plot Conversion to double from cell is not possible.
解决方案:
分析:用花括号直接使用line_style本身。使用cell数组里的元素,而不是cell自身
Notice the use of curly brackets to access line_style; that accesses the contents of
that element of the cell array, rather than the cell itself.
举例:
>> filenames{i}
ans =
Firefox 3.0.xlsx
>> filenames(i)
ans =
'Firefox 3.0.xlsx'
以下代码:
ne_style = { '-r', '-g', '-c', '-xk', '-hm', '-b' };
for i= 1: length(line_style)
plot (A,B,line_style(i),'linewidth',2)
end
%说明:每一次使用plot都使用新的线型。
出现错误: Error using ==> plot Conversion to double from cell is not possible.
解决方案:
plot(A,B,line_style{i},'linewidth',2)
分析:用花括号直接使用line_style本身。使用cell数组里的元素,而不是cell自身
Notice the use of curly brackets to access line_style; that accesses the contents of
that element of the cell array, rather than the cell itself.
举例:
>> filenames{i}
ans =
Firefox 3.0.xlsx
>> filenames(i)
ans =
'Firefox 3.0.xlsx'
相关文章推荐
- 关于“ora-00911: 无效字符 ”的解决方案
- 单表60亿记录等大数据场景的MySQL优化和运维之道 | 高可用架构
- TreeSet 和 TreeMap 的源码分析
- iOS--(转)常用正则表达式
- GPDB的数据倾斜问题
- CentOS 6.7配置安装(Apache+PHP5+MySQL)LAMP服务器
- 学习链接
- 6.进程间通信------管道
- iOS--(转)WiFi传输数据
- IOS开发之实现App消息推送(最新)
- 通过分类(Category)更改UINavigationItem位置,LeftBarButtonItem,RightBarButtonItem位置
- MySQL主从库配置和主库宕机解决方案
- 谈谈java中的WeakReference
- 为什么Java中字符串是不可变的
- c#截取图片
- iOS--(转)WiFi传输数据
- [PHP] 链表数据结构(单链表)
- 池化方法总结(Pooling)
- 关于public ,private protect
- 根据颜色获取图片