Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

"Which Sym" statement so the sym statement will work

Asked by Philosophaie

Philosophaie (view profile)

on 30 Jun 2013
which sym
class(sym)
Gup=sym(zeros(2,2))

I put "which sym" before the sym statement and I still get this error"

??? Subscript indices must either be real positive integers or logicals.
Error in ==> CoAndContraMetricTensors at 7
Gup=sym(zeros(2,2))

0 Comments

Philosophaie

Philosophaie (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Wayne King

Wayne King (view profile)

on 30 Jun 2013

The line:

Gup = sym(zeros(2,2));

works. Therefore the error must be coming from somewhere else in your CoAndContraMetricTensors.m file. You do know that sym() is a MATLAB function so are you also using it as a variable in the M-file?

You don't show us what which sym returns.

0 Comments

Wayne King

Wayne King (view profile)

Answer by Walter Roberson

Walter Roberson (view profile)

on 30 Jun 2013

In your other Question, when I said to put in

which sym
class(sym)

it was a request for you to show us (the people trying to assist you) what those two lines output. The two lines are not intended to repair anything, they are intended to give us volunteers information to better understand your problem. You need to show us the output of those two lines.

0 Comments

Walter Roberson

Walter Roberson (view profile)

Contact us