how to solv this issue?
Afficher commentaires plus anciens
LastName = {'Sanchez';'Johnson';'Li';'Diaz'};
Age = [38;43;38;40];
Smoker = logical([1;0;1;0]);
Height = [71;69;64;67];
Weight = [176;163;131;119];
BloodPressure = [93; 77; 83;80];
BP=[125;135;146;150]
T = table(LastName,Age,Smoker,Height,Weight,BloodPressure,BP)
T1=table2cell(T)
T2=T1(:,2:5)
for i=1:4
for j=1:4
properties=T2(i,j);
end
temp1=T2(i,1);
temp2=T2(i,2);
temp3=T2(i,3);
temp4=T2(i,4);
temp5=T2(i,5);
create(temp1,temp2,temp3,temp4,temp5)
end
function create(temp1,temp2,temp3,temp4,temp5) % now i explained in detail my code
disp('age is')
disp(temp1)
if height==0
disp(temp4)
elseif height==1
disp(temp5)
end
end
% % error index in posiotion exceeds array bounds index must not exceeds 4
% R = [25;50;100;250] This is part of my program which i have tried
% to explain in simple way
% L=10
% A=5
% for i=1:4
% res=R(i)
% resistivity(R,A,L)
% end
%
% function resistivity(R,A,L)
% Rho=(R*L)/A
% end
i am getting an error index exceeds array bounds
how to rectify this error?
2 commentaires
David Hill
le 12 Avr 2022
Where is your error. Code executes without error for me.
ramya
le 12 Avr 2022
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Text Analytics Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!