【问题标题】:matlab cell insertion problemmatlab单元格插入问题
【发布时间】:2011-08-09 16:30:15
【问题描述】:

我正在尝试将彩色图像转换为灰度,调整其大小并将其放入单元格中。我为此编写了以下代码。但我收到一个错误。我究竟做错了什么? 代码:

x=imread(strcat('E:\Documents and Settings\brahadeesh\Desktop\will\101_ObjectCategories\airplanes\',files_a(i).name));
x=imresize(x,[32 32]);
x=rgb2gray(x);
a(i-3)=x;

错误:

??? Conversion to cell from uint8 is not possible.
Error in ==> *** at 16
a(i-3)=x;

【问题讨论】:

    标签: matlab image-processing compiler-errors cell


    【解决方案1】:

    假设a已经被初始化为一个元胞数组,你必须使用花括号来index and replace the content of a cell

    a{i-3} = x;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-17
      相关资源
      最近更新 更多