Multiplying cell with a function call
이전 댓글 표시
Hi, I am facing a problem. It is being described below:
function [ryz] = ryz(a)
ryz= [(cosd(a))^2 -(cosd(a)*sind(a)) -sind(a);
sind(a) cosd(a) 0;
cosd(a)*sind(a) -(sind(a)*sind(a)) cosd(a)];
end
A= [1:6]
[m n] = size(A)
q =floor(n/3)
trips = cell(1, q+1)
for i=1:q
trips{i} = A(:,3*(i-1)+1:3*(i-1)+3);
end
**** Here a cell named trips is being produced. trips = {1 2 3}, {4 5 6} *****
d1 = cell(360,1)
for angle = 1:360
d1{angle} = trips * ryz(angle)
end
But Now an error occurs.
Operator ' * ' is not supported for operands of type 'cell'.
Error in (line 15)
d1{angle} = trips * ryz(angle)
How can I solve this error?
답변 (1개)
Jonas
2021년 7월 2일
0 개 추천
trips is a cell array where each cells contains doibles you created earlier. if you want to calculate something with the content of a cell use e.g. trips{1}
댓글 수: 2
Durlov Rahman
2021년 7월 2일
편집: Durlov Rahman
2021년 7월 2일
Jonas
2021년 7월 3일
then tell us what exactly your desired output for one iteration of the for loop is.
카테고리
도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!