How to Write y(0)=1?

3 views (last 30 days)
Sayali Jadhav
Sayali Jadhav on 3 Dec 2020
Commented: Ameer Hamza on 4 Dec 2020
I want to write y(0)=1
but it shows error and I want to change it to
y(θ)=1
how to write θ in place of 0?
  4 Comments
Sayali Jadhav
Sayali Jadhav on 4 Dec 2020
Thank You so much for responding
Ameer Hamza
Ameer Hamza on 4 Dec 2020
In MATLAB array starts at index 1, so y(1) is the correct way to set initial condition.
"how come others 0 is displayed as θ"
Can you show where it is shown as theta?

Sign in to comment.

Answers (1)

Ameer Hamza
Ameer Hamza on 3 Dec 2020
If you just want to display it, then you can use following code
syms J(theta)
J(theta)=1
This requires the Symbolic toolbox.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!