Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
an error message which I don't understand

Subject: an error message which I don't understand

From: Johannes Deelstra

Date: 7 Dec, 2010 22:00:29

Message: 1 of 7


I am writing an m-file
part of it is;
TN=reshape(TN,12,15);B = TN./repmat(sum(TN,1),size(TN,1),1); TotN=B';clear B;
so far so good, no problem, testing it gives me the right output

Then I write
SS=reshape(SS,12,15);B = SS./repmat(sum(SS,1),size(SS,1),1); Susp=B';clear B;
The number 12 is highlighted and putting the cursor on the 12 I get the following message: Terminate statement with semicolon to supress output (within a script).
An automatic Matlab fix is suggested and if followed gives me the following correction; SS=reshape(SS,12;15) which does not work, it's actually wrong.
Where is the mistake. Have I overlooked something.

Best regards

Johannes



The expression to the left of the equals sign is not a valid target for an assignment. What is wrong

Subject: an error message which I don't understand

From: Sean de

Date: 7 Dec, 2010 22:11:04

Message: 2 of 7

"Johannes Deelstra" <johannes.deelstra@bioforsk.no> wrote in message <idmapt$5g8$1@fred.mathworks.com>...
>
> I am writing an m-file
> part of it is;
> TN=reshape(TN,12,15);B = TN./repmat(sum(TN,1),size(TN,1),1); TotN=B';clear B;
> so far so good, no problem, testing it gives me the right output
>
> Then I write
> SS=reshape(SS,12,15);B = SS./repmat(sum(SS,1),size(SS,1),1); Susp=B';clear B;
> The number 12 is highlighted and putting the cursor on the 12 I get the following message: Terminate statement with semicolon to supress output (within a script).
> An automatic Matlab fix is suggested and if followed gives me the following correction; SS=reshape(SS,12;15) which does not work, it's actually wrong.
> Where is the mistake. Have I overlooked something.
>
> Best regards
>
> Johannes
>
>
>
> The expression to the left of the equals sign is not a valid target for an assignment. What is wrong

MLINT does not show any hints to me.
%%% with this:
TN=reshape(TN,12,15);B = TN./repmat(sum(TN,1),size(TN,1),1); TotN=B';clear B;
SS=reshape(SS,12,15);B = SS./repmat(sum(SS,1),size(SS,1),1); Susp=B';clear B;

Subject: an error message which I don't understand

From: Sean de

Date: 7 Dec, 2010 22:19:05

Message: 3 of 7


> MLINT does not show any hints to me.
> %%% with this:
> TN=reshape(TN,12,15);B = TN./repmat(sum(TN,1),size(TN,1),1); TotN=B';clear B;
> SS=reshape(SS,12,15);B = SS./repmat(sum(SS,1),size(SS,1),1); Susp=B';clear B;

R2009b 64bit

Subject: an error message which I don't understand

From: Walter Roberson

Date: 7 Dec, 2010 22:21:50

Message: 4 of 7

On 10-12-07 04:00 PM, Johannes Deelstra wrote:
>
> I am writing an m-file
> part of it is;
> TN=reshape(TN,12,15);B = TN./repmat(sum(TN,1),size(TN,1),1);
> TotN=B';clear B;
> so far so good, no problem, testing it gives me the right output
>
> Then I write SS=reshape(SS,12,15);B =
> SS./repmat(sum(SS,1),size(SS,1),1); Susp=B';clear B;
> The number 12 is highlighted and putting the cursor on the 12 I get the
> following message: Terminate statement with semicolon to supress output
> (within a script). An automatic Matlab fix is suggested and if followed
> gives me the following correction; SS=reshape(SS,12;15) which does not
> work, it's actually wrong.
> Where is the mistake. Have I overlooked something.
>
> Best regards
>
> Johannes
>
>
> The expression to the left of the equals sign is not a valid target for
> an assignment. What is wrong

Please paste the *exact* code you have now.

Subject: an error message which I don't understand

From: Matt Fig

Date: 7 Dec, 2010 22:22:06

Message: 5 of 7

If I copy and past the two lines you show, M-lint says nothing.

I suspect the error is in some of the code you are not showing. I have found that when there is something wrong in the code but M-lint cannot really identify the problem it can get confused and put up an inaccurate message. I would start by not having more than one command on a line. Then comment out each line one by one, starting from the bottom, until you find the correct error.

Subject: an error message which I don't understand

From: ImageAnalyst

Date: 7 Dec, 2010 22:24:27

Message: 6 of 7

No problems for me in R2010b. No suggested fixes.
But I'd recommend you at least put them on separate lines to increase
readability.
At the very least, put a space or tab before the semicolons.

Subject: an error message which I don't understand

From: Johannes Deelstra

Date: 7 Dec, 2010 23:44:05

Message: 7 of 7

"Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <idmbdo$fls$1@fred.mathworks.com>...
> "Johannes Deelstra" <johannes.deelstra@bioforsk.no> wrote in message <idmapt$5g8$1@fred.mathworks.com>...
> >
> > I am writing an m-file
> > part of it is;
> > TN=reshape(TN,12,15);B = TN./repmat(sum(TN,1),size(TN,1),1); TotN=B';clear B;
> > so far so good, no problem, testing it gives me the right output
> >
> > Then I write
> > SS=reshape(SS,12,15);B = SS./repmat(sum(SS,1),size(SS,1),1); Susp=B';clear B;
> > The number 12 is highlighted and putting the cursor on the 12 I get the following message: Terminate statement with semicolon to supress output (within a script).
> > An automatic Matlab fix is suggested and if followed gives me the following correction; SS=reshape(SS,12;15) which does not work, it's actually wrong.
> > Where is the mistake. Have I overlooked something.
> >
> > Best regards
> >
> > Johannes
> >
> >
> >
> > The expression to the left of the equals sign is not a valid target for an assignment. What is wrong
>
> MLINT does not show any hints to me.
> %%% with this:
> TN=reshape(TN,12,15);B = TN./repmat(sum(TN,1),size(TN,1),1); TotN=B';clear B;
> SS=reshape(SS,12,15);B = SS./repmat(sum(SS,1),size(SS,1),1); Susp=B';clear B;


Thanks very much
Checking once more I dicoverd the reason
One line before I had written the following; d = {'summer','fall','winter','spring'
so without the "}", which was the problem.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us