MATLAB Code Call Cell Array Variable
조회 수: 1 (최근 30일)
이전 댓글 표시
I am using one function to call another. I have a cell that contains several pieces of data in 220 different columns of the cell. I am getting an error when I call the function below from the main function. It says "Function 'subsindex' is not defined for values of class 'cell'." Can I not pass the cell array data through the function?
function [] =plotdetailsdata(data1)
num = length(data1);
v_ceil = ceil(num/50);
v_floor = floor(num/50)
for j=0:v_floor
%
num1 = (j*50)+1;
num2 = num1+50 ;
if((num2)>length(data1))
num2 = length(data1)
end
%
figure(j+1+2);
hold on;
%
for i=num1:num2
m = data1{1,i};
plot(m(:,1),m(:,2));
legendCell{i} = num2str(i,'N=%-d');
end
%
title(['Real Impedance from ', num2str(num1), ' to ', num2str(num2)])
hold off;
legend(legendCell{num1:num2});
fig = figure;
datacursormode on;
%
filename=strcat('Figure',num2str(num1),'to',num2str(num2),'RealImp.fig');
savefig(fig,filename)
dcm_obj = datacursormode(fig);
set(dcm_obj,'UpdateFcn',@myfunction)
%
end
legend('show')
end
%
댓글 수: 2
Stephen23
2018년 6월 6일
@Sarah Crimi: please show the complete error message. This means all of the red text.
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!