Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to check the value of a varriable of a subfunction?

조회 수: 1 (최근 30일)
Shaila parvin
Shaila parvin 2013년 6월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
Suppose, I've a function called creating_learning_set.
function [Instances T_target]=create_learning_set()
srcFiles = dir('colored_textures\LearningSet\cloud\*.jpg'); % the folder in which ur images exists
Iin=[]; %this hold the data as input to the neural network
Target=[]; %this holds the target or the required result for each class %we put it manully. %read the folder containing the colud images
for i = 1 : length(srcFiles)
filename = strcat('colored_textures\LearningSet\cloud\',srcFiles(i).name);
I = imread(filename); %read the image
F=get_image_features(I);
.............
.............
(some lines are here)
end
function [F]=get_image_features(Icolored) %% get R G B components of the sub-image
R = Icolored(:,:,1);
G = Icolored(:,:,2);
B = Icolored(:,:,3);
.......... ..........
(some lines are here. )
end
Now I want to checked the value of R from get_image_features(Icolored) after debugging. But it shows me an error that "Error in ==> get_image_features at 5 R = Icolored(:,:,1);"
How can I do it?

답변 (1개)

Iain
Iain 2013년 6월 24일
You can use the command line option
dbstop if error
Or you can insert breakpoints inside your function to inspect (or change) the values at that point of the execution.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by