Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MATLAB examples are failing

Tags:

matlab

I don't have the slightest idea what's going on here, and Google provides no interesting help. I took the following example from http://www.mathworks.com/help/toolbox/symbolic/solve.html#inputarg_eqn

>> syms x
>> solve(x^2 + 4*x + 1 == 0)
??? Error using ==> char
Conversion to char from logical is not possible.

Error in ==> solve>getEqns at 169
   vc = char(v);

Error in ==> solve at 67
[eqns,vars] = getEqns(varargin{:});

What's going on here?

like image 241
Dan Avatar asked Mar 26 '12 03:03

Dan


People also ask

Why is MATLAB so laggy?

Direct link to this answerIf you have limited memory (RAM), your processor may start using virtual memory (from your hard drive). Accessing information from the hard drive is extremely slow compared to accessing information from RAM. To speed up MATLAB: 1.

Why has MATLAB stopped working?

One of the most common reasons MATLAB will fail to start is that something has corrupted the MATLAB preferences directory. You will need to reset your preferences to fix this. Use the shortcut %AppData% from Windows Search to jump right to the current user's hidden AppData folder.

How do I fix errors in MATLAB?

If you are unfamiliar with the problem, right-click the highlighted code. The first item in the context menu shows the suggested fix. Select the item to apply the fix. If multiple instances of a problem exist, MATLAB might offer to apply the suggested fix for all instances of the problem.

What is assertion error in MATLAB?

This error can occur if the System Fonts have been corrupted. In order for MATLAB to start properly, you will need to identify and repair any corrupted Windows Fonts.


1 Answers

The documentation you're reading doesn't apply to your version of MatLab. I can reproduce your error in 2008b, for example.

The older documentation says:

Note that these examples assume equations of the form f(x) = 0. If you need to solve equations of the form f(x) = q(x), you must use quoted strings. In particular, the command

s = solve('cos(2*x)+sin(x)=1')

In the future, pay attention to the line at the top of every MatLab online documentation page where it says what version the documentation applies to.

like image 193
Ben Voigt Avatar answered Nov 15 '22 05:11

Ben Voigt