how to Enter same string in whole column?
조회 수: 22 (최근 30일)
이전 댓글 표시
Hello, I have a Table some of its columns have variable value but for some i have to fix the column value with a string.
for example:
col1
"str1"
"str1"
"str1"
"str1"
Thank you.
댓글 수: 0
채택된 답변
Voss
2022년 7월 16일
% a table with varying values:
t = table( ...
["str1";"str2";"str3";"str4";"str5"], ...
[1;2;3;4;5], ...
'VariableNames',{'col1','col2'})
% set all the values in col1 to "str1":
t.col1(:) = "str1"
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!