How to create a 1x12 matrix of only .
6 views (last 30 days)
Show older comments
Hello I'm new to matlab and I need to creat a matrix of points . in matlab then combine it with string array.
2 Comments
OCDER
on 11 Oct 2018
Can you show us what you want as the output? Example:
[Replace below with what you want as the output]
... + "this is a string" = "...this is a string" ??
Accepted Answer
More Answers (2)
Guillaume
on 12 Oct 2018
a = [1;2;3];
b = [3;2;1];
Two easy options:
compose('%d.%d', a, b) %or compose("%d.%d", a, b) to get a string array instead of a cell array of char arrays
or
string(a) + "." + string(b)
madhan ravi
on 11 Oct 2018
Edited: madhan ravi
on 12 Oct 2018
a = [1;2;3];
b = [3;2;1];
idx = [a b]
sprintf('%.f.%.f \n',idx')
EDITED
3 Comments
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!