Save data to Excel without overlapping

4 ビュー (過去 30 日間)
Teo Chou Wen
Teo Chou Wen 2020 年 6 月 27 日
コメント済み: Teo Chou Wen 2020 年 7 月 4 日
A, a 3x2 variables that store 3 points detected.
B, variable to store angle of that 3 points.
A and B is in a for loop, since I detect many frames (around 400 frames).
How can I store A and B for all frames in two different excel files.
Excel filename for A: Coordinates.xlsx, B: Angle.xlsx

採用された回答

Sindar
Sindar 2020 年 6 月 27 日
Something like this should work:
writematrix(A,'Coordinates.xlsx','WriteMode','append')
writematrix(B,'Angle.xlsx','WriteMode','append')
  10 件のコメント
Sindar
Sindar 2020 年 7 月 1 日
編集済み: Sindar 2020 年 7 月 1 日
Looking back at it, I realize that you probably want three thetas to a row. In that case, try this:
thetas=nan(1,length(stats));
for object=1:length(stats)
...
theta2=atan((AllCentroids(end,end)-AllCentroids(2,end))/(AllCentroids(end,1)-AllCentroids(2,1)));
theta=(abs((theta1-theta2)*(180/pi)));
%set the position of Angle display
p=10.0;
q=15.0;
t=text(theta,theta,strcat('Angle: ',[sprintf('%1.2f',theta),'{\circ}']),'FontName', 'Arial',...
'FontWeight', 'bold', 'FontSize', 12, 'Color', 'white');
set(t,'Position',[p q 0]);
thetas(object) = theta;
end
writematrix(thetas,'Angle.xlsx','WriteMode','append')
Teo Chou Wen
Teo Chou Wen 2020 年 7 月 4 日
Thanks. The code work well as I need.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by