Error: Unexpected MATLAB expression.

8 ビュー (過去 30 日間)
Putra
Putra 2023 年 3 月 27 日
コメント済み: Walter Roberson 2023 年 3 月 27 日
Hello. This is my code and I keep getting the error "Unexpected MATLAB Expression", several times throughout but can't find the mistake.
Error in line 'Buka citra asli';
% --- Executes on button press in open.
function open_Callback(hObject, eventdata, handles)
% hObject handle to open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[nama_file1, nama_path1]=uigetfile(...
{'*.bmp; *.jpg',' File Citra(*.bmp, *.jpg)';
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File Jpeg(*.jpg)';...
'*.*', 'Semua File(*.*)'}...
'Buka citra asli';

回答 (1 件)

Cris LaPierre
Cris LaPierre 2023 年 3 月 27 日
編集済み: Cris LaPierre 2023 年 3 月 27 日
You are missing your closing paretheses, as well as a comma to separate the final line from the cell array..
[nama_file1, nama_path1]=uigetfile(...
{'*.bmp; *.jpg',' File Citra(*.bmp, *.jpg)';
'*.bmp','File Bitmap(*.bmp)';...
'*.jpg','File Jpeg(*.jpg)';...
'*.*', 'Semua File(*.*)'},...
'Buka citra asli');
  2 件のコメント
Putra
Putra 2023 年 3 月 27 日
Sorry your answer still raises error of unexpected matlab expression
Walter Roberson
Walter Roberson 2023 年 3 月 27 日
Cris's suggested code works fine on my system.
Notice that Cris made two changes:
  1. Add a comma after the 'Semua File(*.*)'} and before the ...
  2. add closing ')' after 'Buka citra asli'

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by