Error using sin Not enough input arguments

50 Ansichten (letzte 30 Tage)
Jay Seno
Jay Seno am 30 Sep. 2020
Beantwortet: Star Strider am 30 Sep. 2020
Im new to mathlab and getting this error while typing in the command y4=(sin(t))*(sin*t)
im trying too create a subplot and have typed in y1 y2 y3 without a issue

Antworten (2)

Cris LaPierre
Cris LaPierre am 30 Sep. 2020
sin is a function, which means you must give it an input. The error here is with the code sin*t at the end of your expression. Did you mean sin(t)? Take a look at the documentation page for sin for more.

Star Strider
Star Strider am 30 Sep. 2020
You have it partially correct.
Try this:
y4 = sin(t) .* sin(t);
If you want to multiply thge second one by ‘t’ do this:
y4 = sin(t) .* sin(t).*t;
This uses element-wise multiplication (the dot operator, so .* instead of *). I n the event that ‘t’ is a vector, it will produce a vector result. It will also work correctly if ‘t’ is a scalar.
.

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by