Filter löschen
Filter löschen

What's wrong with this script?

2 Ansichten (letzte 30 Tage)
Shi Yuhao
Shi Yuhao am 27 Apr. 2014
Kommentiert: Shi Yuhao am 27 Apr. 2014
t = linspace(0,2,100)
x = linspace(0,10,100)
U(t,x) = 10*sin(2*pi*(t-x/5))+2*sin(2*pi*(t+x/5))

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 27 Apr. 2014
You cannot use 0 or fractions in your indices into U.
The syntax you are using is not a function definition: the syntax is an array access.
Use
U = 10 * sin(2 * pi * (t-x/5)) + 2 * sin(2 * pi * (t+x/5));

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 27 Apr. 2014
t = linspace(0,2,100)
x = linspace(0,10,100)
U= 10*sin(2*pi*(t-x/5))+2*sin(2*pi*(t+x/5))

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by