Problem in GUI interface

1 回表示 (過去 30 日間)
brahmi ibtissem
brahmi ibtissem 2018 年 3 月 25 日
回答済み: Walter Roberson 2018 年 3 月 27 日
Hi, please when i run my GUI interface, I have this error:
Error using repmat
Replication factors must be a row vector of integers or integer scalars.
Error in drawColormap (line 36)
coordX_Matrix = repmat(coordX_Matrix_t,y_samples,1);
Error in simul1>pushbutton100_Callback (line 416)
drawColormap(handles);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in simul1 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)simul1('pushbutton100_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
the code of y_samples is:
coordX_Matrix_t = ones(1,x_samples);
ind = find(coordX_Matrix_t)-1;
coordX_Matrix_t = ((max_x * 2.0) / x_samples)*ind;
coordX_Matrix = repmat(coordX_Matrix_t,y_samples,1);
%coordX_Matrix = repmat(coordX_Matrix_t,1,y_samples);
coordY_Matrix_t = ones(fix(y_samples),1);
ind2 = find(coordY_Matrix_t)-1;
coordY_Matrix_t = ((max_y * 2.0) / y_samples)*ind2;
coordY_Matrix = repmat(coordY_Matrix_t,1,x_samples);
coordVectors = get(handles.figure1, 'UserData');
it=coordVectors.it;
[EDITED, Jan, Duplicate posts joined, code formatted]
  3 件のコメント
Jan
Jan 2018 年 3 月 26 日
@brahmi ibtissem: Please post one thread per problem only. Use the "{} Code" button to format your code. Thanks.
brahmi ibtissem
brahmi ibtissem 2018 年 3 月 27 日
Hi, The problem appear in my interface when i click to Run simulation button. The color of axes changes to blue. can you help me how i solve this problem. I need that the color of axe remains colorless and the blue color disappear. This is the code of the gui interface:simul1.m The code of the drawColormap in the <file:drawColormap.m>

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

回答 (2 件)

brahmi ibtissem
brahmi ibtissem 2018 年 3 月 26 日
Thanks. BUt i stil have the same error: this is the syntax: coordX_Matrix_t = ones(1,x_samples); ind = find(coordX_Matrix_t)-1; coordX_Matrix_t = ((max_x * 2.0) / x_samples)*ind; coordX_Matrix = repmat(coordX_Matrix_t,y_samples,1); %coordX_Matrix = repmat(coordX_Matrix_t,1,y_samples); coordY_Matrix_t = ones(fix(y_samples),1); ind2 = find(coordY_Matrix_t)-1; coordY_Matrix_t = ((max_y * 2.0) / y_samples)*ind2; coordY_Matrix = repmat(coordY_Matrix_t,1,x_samples);
coordVectors = get(handles.figure1, 'UserData'); it=coordVectors.it; The same error appear when i run my interface.
  2 件のコメント
Rik
Rik 2018 年 3 月 26 日
Read the two links I posted. Also, you posted this as an answer instead of a comment. You should delete this answer and post it as a comment, after having read the two links I provided.
Rik
Rik 2018 年 3 月 26 日
I didn't mean you should post a new question, I meant you should post this text as a comment and correctly format it. (use the {}Code button)

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


Walter Roberson
Walter Roberson 2018 年 3 月 27 日
double(uint16(sqrt(3)*125))
Is 217. You multiply this by 2 and divide by 4, which gives you a non integer that cannot be used as a replication factor.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by