フィルターのクリア

how do you delete a column from a structure?

4 ビュー (過去 30 日間)
Imtiaz nabi
Imtiaz nabi 2022 年 2 月 17 日
コメント済み: Voss 2022 年 2 月 17 日
Hi there I have a structure with 1x12 configuration the structure contains 12 cells and each cell contains further structures
for example struct.apple = [1x1 apple 1x2 apple 1x3 apple 1x5 apple......]
inside each there is further data such as
apple(1,1).color apple(1,2).size apple(1,3).taste.rating etc
I want to use an if statement and remove a whole cell from the structure struct.apple = [1x1 apple 1x2 apple 1x3 apple 1x5 apple......] whenever the condition is false
such as if taste == good
don't do anything
else
[1x1 apple 1x2 apple 1x3 apple 1x5 apple......] = remove apple(1x2)
new struct will become [1x1 apple 1x3 apple 1x5 apple......]
I am sorry for such a messy explaination but can we remove the whole cell columns from the structure?
  3 件のコメント
Imtiaz nabi
Imtiaz nabi 2022 年 2 月 17 日
Hi yes but actually the feild contains other elements too due to which I am getting an error
Voss
Voss 2022 年 2 月 17 日
I second @Jan's suggestion: please share the actual relevant code, as well as the actual complete text of the error message you are getting when you run it.

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by