App designer Edit field, position

6 ビュー (過去 30 日間)
Eliska Paulikova
Eliska Paulikova 2023 年 3 月 17 日
コメント済み: Voss 2023 年 3 月 19 日
thisFrame = read(vid, framesToRead(h));
pos1=app.CTRLVEditField.Value
str = strrep(pos1, '[', ''); % Odstranění závorek
str = strrep(str, ']', '');
values= split(str, ','); % Rozdělení řetězce podle čárky
pos = str2double(pos1) % Převod na čísla
cr=imcrop(thisFrame,pos);
Hello, I work in App designer, where I put into Edit filed the area I would like to crop in this type [1 2 3 4], but in the position cr=imcrop ... the matlab says
Input number 2, RECT, is expected to contain 4 elements.
validateRectangle(spatial_rect,2);
Error in imcrop (line 104)
images.internal.crop.parseInputsOverTwo(varargin{:});
How can I solve this problem. Thank you.

採用された回答

Voss
Voss 2023 年 3 月 17 日
pos1 = "[1 2 3 4]";
pos = str2num(pos1)
pos = 1×4
1 2 3 4
  2 件のコメント
Eliska Paulikova
Eliska Paulikova 2023 年 3 月 18 日
Thank you
Voss
Voss 2023 年 3 月 19 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by