Simplest way to save a vector to a variable with commas and braces
이전 댓글 표시
How a can I save a numeric vector a= 1 2 3 4 5
as [1,2,3,4,5] (braces and commas are to be added here)
with a simple solution
채택된 답변
추가 답변 (1개)
Bhaskar R
2020년 2월 27일
You can't save the variable data like that but you can store as in string format
a = '[1, 2, 3, 4, 5]'
save matfile a
load matfile
a = str2num(a)
댓글 수: 2
Vinay Killamsetty
2020년 2월 27일
편집: Vinay Killamsetty
2020년 2월 27일
Stephen23
2020년 2월 27일
"We have to add commas and braces to the vector."
Why? What is the purpose of this?
카테고리
도움말 센터 및 File Exchange에서 Standard File Formats에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!