Error in Octave

  • Thread starter waht
  • Start date
1,464
3
When I generate a list x = (-10:0.1:10)

and want to evaluate it using a function

exp(x) * sin(x)

I get this error

error: operator *: nonconformant arguments (op1 is 1x101, op2 is 1x101)
error: evaluating binary operator `*' near line 4, column 11
error: evaluating assignment expression near line 4, column 3
wondering what's the problem here?
 

Dr Transport

Science Advisor
Gold Member
2,211
385
try exp(x).*sin(x) which is a matrix element by element multiply which should give you a 1 x 101 matrix.
 
1,464
3
Thanks in worked. Didn't know you had to use .* operator.
 

Related Threads for: Error in Octave

Replies
1
Views
582
  • Posted
Replies
1
Views
2K
  • Posted
Replies
2
Views
1K
  • Posted
Replies
2
Views
2K
Replies
2
Views
4K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top