[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## I am trying to enter a function and input multiple variables

**From**: |
naryana.shankara |

**Subject**: |
I am trying to enter a function and input multiple variables |

**Date**: |
Sun, 3 Jul 2016 15:19:44 -0700 (PDT) |

I have 2 functions:
(cot(x))-1
(cos(2*(x)))/((1+(cot(x)))*(sin(x))^2)
and I need to enter the same values and compare the outputs. This is a loss
of significance problem for a math class.
The values are
(pi/4),((5*pi)/4),((3*pi)/4) and ((7*pi)/4)
my code is
clear all
A=(cot(x))-1
B=(cos(2*(x)))/((1+(cot(x)))*(sin(x))^2)
x=[(pi/4),((5*pi)/4),((3*pi)/4),((7*pi)/4)]
x*A
x*B
my output is
>*>>error: `x' undefined near line 2 column 8*
error: evaluating argument list element number 1
error: called from:
error: /home/shankara/Documents/M365/HW2P2.m at line 2, column 2
I know I am doing something like comparing a function with a vector and
octave is grumbling.
What am I doing wrong and what should my code look like?
thanks
--
View this message in context:
http://octave.1599824.n4.nabble.com/I-am-trying-to-enter-a-function-and-input-multiple-variables-tp4678154.html
Sent from the Octave - General mailing list archive at Nabble.com.

**I am trying to enter a function and input multiple variables**,
*naryana.shankara* **<=**