Convertion to double from struct is not possible

3 ビュー (過去 30 日間)
Bárbara Matos
Bárbara Matos 2021 年 12 月 2 日
コメント済み: Bárbara Matos 2021 年 12 月 4 日
Hello! I am trying to do two things, but the ideia it's the same. In the first case (image 1) I want to save app.input_signal in a matrix. For example, if my app.checkBoxValue == 1, I want that all the elements of the matrix have the same app.input_signal. But the app.input_signal is a .mat file with 2 fields. I don't know how to do it.
In the second case (image 2), I want to do exactly the same thing, but the app.input_dpd is the field x of the app.input_signal after passing some function.
I have to different errors. Can you help me please?

採用された回答

Image Analyst
Image Analyst 2021 年 12 月 2 日
How about getting rid of the double for loop and just do it vectorized
[rows, columns] = size(app.input_signal_array)
% Copy the x field all the way down the array for each and every row.
app.input_signal_array = repmat(app.input_signal.x, [rows, 1]);
  1 件のコメント
Bárbara Matos
Bárbara Matos 2021 年 12 月 4 日
Thank you! I will try this :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by