How to store words and numbers table in an array

14 ビュー (過去 30 日間)
Benjamin Currie
Benjamin Currie 2021 年 4 月 7 日
コメント済み: Adam Danz 2021 年 4 月 8 日
can anyone help me to create an empty array to store a 11 x 3 string array.
I am rating a loop to store each value for every image. i have to loop i just can't create a suitable array to store the words and numbers. This is what each image gives out:
"Sky" "268032" "786432"
"Building" "0" "0"
"Pole" "131" "786432"
"Road" "734" "786432"
"Pavement" "7610" "786432"
"Tree" "7450" "786432"
"SignSymbol" "7082" "786432"
"Fence" "5490" "786432"
"Car" "6912" "786432"
"Pedestrian" "3669" "786432"
"Bicyclist" "9836" "786432"
Thanks.
  12 件のコメント
Benjamin Currie
Benjamin Currie 2021 年 4 月 8 日
what is this vairable 'm' you are using or 'j' and 'i'? im guessing the 'n' is n i have already declared but none of these other values have been declared.
Adam Danz
Adam Danz 2021 年 4 月 8 日
They are just indices.
n and m are defined in my comment (".... for nxm empty cell array).
i and j are just indices. c(i,j) is the i_th row and the j_th column.

サインインしてコメントする。

回答 (1 件)

David Hill
David Hill 2021 年 4 月 7 日
Why not set up a struct?
s = struct('a',{},'b',{},'c',{});%label the fields to whatever you want
for k=1:11
s(k).a=%'Building' from picture
s(k).b=%268032
s(k).c=%786432
end

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by