The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: convert vectors to scalars
Replies: 1   Last Post: Nov 26, 2013 12:14 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 176
Registered: 8/30/11
Re: convert vectors to scalars
Posted: Nov 26, 2013 12:14 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Monika " <> wrote in message <l70sn0$hg7$>...
> Hi,
> I have problem with matlab
> ??? Operands to the || and && operators must be convertible to logical scalar
> values.
> Error in ==> program_glowny88 at 288
> if (kaszel > smiech && kaszel > krzyk && kaszel> chrzakanie)
> How should I convert vectors to scalars in my program. I don't have numbers only words (cough, grunt, laugh, speach)

the problem is that some of the operators kaszel, smiech, etc. are not scalars but vectors

if you type: size(kasyel) i bet you dont get rows:1, columns: 1. i am not sure what you intend to do, but you should convert the code such that the logical give a scalar 0 or 1. that means that comparing two vectors will not work...

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.