MATLAB Answers

0

Label with num2str

Asked by Abdulkadir Genç on 12 Aug 2018 at 10:33
Latest activity Commented on by Abdulkadir Genç on 12 Aug 2018 at 22:00

Hello everyone,

I want to use num2str and I actually managed to use it but I faced a very little problem.

xlabel({"effective stress","ID=" num2str(Id)})

When I write this part of code, x label consists of 3 lines;

1:effective stress

2:ID=

3:'the value of Id'

But I need the 2nd and the 3rd lines to appear on the same line. It is a small detail but I need it for my thesis. Can you please help me.

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by Stephen Cobeldick on 12 Aug 2018 at 12:05
 Accepted Answer

xlabel({'effective stress',['ID=',num2str(Id)]})

  3 Comments

Worked, thanks!

Stephan Jung on 12 Aug 2018 at 13:10

I did not read your question carefully enough and thought you wanted everything in one line. Excuse me.

Best regards

Stephan

Thanks for your interest Stephan.

Best regards.

Sign in to comment.