Something is nuts. Why would a working script stopped working???

조회 수: 1 (최근 30일)
James Andrada
James Andrada 2019년 5월 24일
댓글: James Andrada 2019년 5월 24일
I've been running a script several dozen times. The last time it started complaining about an assignment operator
PathFile=[Path FileToGet]
Error: Incorrect use of '=' operator. To assign a value to a variable, use '='. To compare values for equality,
use '=='.
I don't see anything incorrect and it was working an hour or so ago. Any ideas
Path=uigetdir;
Path=[Path '\']
String='*csv';
Files=dir([Path String]);
NumberOfFiles=numel(Files);
for JJJ=1:NumberOfFiles
FileToGet=Files(JJJ).name
FileToSave=[FileToGet(1:end-4) ['.jpg']
PathFile=[Path FileToGet]
T=readmatrix(FilePath);
SizeT=size(T);
LastRowT= SizeT(1);
LastColT= SizeT(2);
T1=T(5:LastRowT,2:LastColT);
SizeT1=size(T1);
LastRow=SizeT1(1);
LastCol=SizeT1(2);
DataArray=T1-T1(1,1:LastCol);
DataArray=DataArray*-1;
figure('Name',FileToGet)
ribbon(DataArray);
ylim([1 LastRow])
Min=-50
Max=500
xlim([1 40])
zlim([Min Max]);
end

채택된 답변

per isakson
per isakson 2019년 5월 24일
편집: per isakson 2019년 5월 24일
The line before is in error (the brackets aren't balanced)
FileToSave=[FileToGet(1:end-4) ['.jpg']
The Code Analyzer box points at the error
Make the Code Analyzer box green!
  댓글 수: 3
per isakson
per isakson 2019년 5월 24일
I never use the editor undocked. However, the box is active in this undocked editor window.
Capture.PNG
It's possible to generate a report of Code Analyzer messages. See checkcode, Check MATLAB code files for possible problems
James Andrada
James Andrada 2019년 5월 24일
Thanks much. I found it!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by