How can I express all the variables Vcm1, Vcm2, Vcm3, Vcm4 in num2str without getting an error?

조회 수: 1 (최근 30일)
annotation('textbox',dim,'String',((num2str(Vcm1),num2str(Vcm2),num2str(Vcm3),num2str(Vcm4)), 'FontSize';15)
  댓글 수: 2
Stephen23
Stephen23 2024년 7월 4일
What are Vcm1, etc? What types and values do they have? What is the expected output from num2str ?
Carolina
Carolina 2024년 7월 4일
I'm trying to represent the center of mass velocities in a 4-link model, so I want my center of mass velocities to be seen in my animation through num2str, I already have my values defined for each velocity but I just want to know what commands apply so that the 4 speeds are seen on the graph

댓글을 달려면 로그인하십시오.

채택된 답변

Aquatris
Aquatris 2024년 7월 4일
Dont know what exactly you are trying to do but here is an example using your variable names:
dim = [0.2 .5 0.25 0.1];% normalized dimensions
Vcm1 = 1.05;
Vcm2 = 2.05;
Vcm3 = 6.52;
Vcm4 = -2.56;
myText = sprintf('%.2f, %.2f, %.2f, %.2f',Vcm1,Vcm2,Vcm3,Vcm4);
figure(1)
plot([0 10],[0 10])
annotation('textbox',dim,'String',myText, 'FontSize',8)

추가 답변 (1개)

Carolina
Carolina 2024년 7월 4일
Yes, I have exactly a similar example but I didn't know how to express the four velocities of the center of mass in num2str because I want to represent them in my animation of the velocities, but that command came out as an error

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by