2016-12-04 80 views
2

我试图运行一些简单的八度脚本,但是我遇到了以下问题。Octave无法识别.m文件中的更改

假设我的脚本中有错误A.当我尝试运行该脚本时,八度音程会报告我在第10行第10列中看到了错误A.我将此行注释掉并尝试再次运行脚本,但八度音符继续报告第10行中的错误A列10.

所以,现在的代码。

我的主要scrips包含以下内容:

clear; clc; 

#test_image_path = "/home/roman/Documents/prog/Prototype/project/resources/image/1.jpg"; 
test_image_path = "/home/roman/Documents/prog/Prototype/project/resources/image/3x3.jpeg"; 

plotter_obj = plotter(); 

source_image = imread(test_image_path); 
plotter_obj.add_plot(source_image); 

xyz_image = custom_image_conversion_routines.rgb2ciergb(source_image); 
plotter_obj.add_plot(xyz_image); 

plotter_obj.draw() 

plotter_obj.draw()被调用时,下面的类应该工作:

classdef plotter < handle 
    properties (Hidden, SetAccess = protected) 
    column_no = 0; 
    row_no = 0; 
    plots = {}; 
    end 

    methods 
    function obj = plotter() 
     disp('plotter created'); 
    end 

    function add_plot(obj, plot) 
     obj.plots{end + 1} = plot; 
    end 

    function draw(obj) 
     vector_len = size(obj.plots) 
     grid_axis_size = ceil(sqrt(vector_len)); 

     for index = 1:vector_len 
     subplot(grid_axis_size, grid_axis_size); 
     imshow(obj.plots{index}); 
     endfor 
    end 

    end 

end 

八度报告以下错误:

error: 'len' undefined near line 18 column 20
error: called from
draw at line 18 column 18
rg_chromacity_based_wavelet_transform at line 15 column 1

但是没有len符号在绘制方法中再次提到。

我可以摆脱错误信息的唯一方法是关闭八度并重新启动它。

会发生什么?我是否应该在修改我的类方法后以某种方式重置我的工作环境?

+0

在这里发布您的代码! –

回答

2

如果您对班级进行了更改,您可能需要clear that class才能使更改生效。

clear -classes 
+0

谢谢,这工作。 – Roman

相关问题