spdiags command not working

>> Dx=spdiags([e 2*e e], -1:1, Nx,Nx)/(dx)^{2}
Undefined operator '^' for input arguments of type 'cell'.
What is wrong with this line? cant figure it out.

 Accepted Answer

Steven Lord
Steven Lord on 3 May 2017
Remove the curly braces from around the 2 at the end of your statement.

2 Comments

Actually your suggestion worked! Thank you!

Sign in to comment.

More Answers (0)

Categories

Asked:

on 3 May 2017

Commented:

on 3 May 2017

Community Treasure Hunt

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

Start Hunting!