Matlab: How to type single quotes in eval function (how to use)

A basic principle to remember: single quotes in strings, use two single quotes to define (not a double quote)!

1: For example, I want to output [1 2]', that is, its transpose [1;2], then I can use the command

eval(['disp([1 2]'')'])

Transpose the matrix

1
2

2: Contrast

eval(['disp([1 2])'])

result:

1  2

Guess you like

Origin blog.csdn.net/qq_40797015/article/details/109891449