2016-12-04 83 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

相關問題