Error in the execution of the simultaneous differential equation

i want the follwing code in matlab but it showing the error message, herewith i am attaching a jpeg file with complete code and error message which i ma getting after executing the program. or if you wnat to the complete problem then you can follow the following math work link https://in.mathworks.com/matlabcentral/answers/questions/new/?s_tid=gn_mlc_ans_ask
syms f(t) g(t)
syms f(t) g(t)
[f(t), g(t)] = dsolve(diff(f) == 3*f + 4*g, diff(g) == -4*f + 3*g, f(0) == 0, g(0) == 1)

Answers (2)

The code in your posted image corresponds to
syms f(t)g(t)
with no space between the f(t) and g(t).

8 Comments

but after that also it is showing the error, the jpeg file of that error message with code i am attaching herewith
The difficulty is detected at run-time, not at parse time. MATLAB does not know that
syms f(t)g(t)
is not valid syntax, so it calls
syms('f(t)g(t)')
and syms() complains about the syntax.
Just fix the syntax:
syms f(t) g(t)
dear sir i tried all the way....this code can you send the image file of yours running code with its output.
i tried syms f()g(t) also
i tried syms 'f(t)g(t)' also
i tried syms('f(t)g(t)') also
i tried syms f(t) g(t) also
i tried syms ('f(t) g(t)')
i tried syms 'f(t) g(t)' also
but in all the ways error is there. so please send me the image file of yours executed program with its output.
I do not have the symbolic toolbox so I cannot send an image of it executing.
you are also executing this code in matlab or in some other tool box
I am executing the code in my mind, taking into account documentation such as "Creating Symbolic Functions"
If at some point I need to check the mathematics, I will use a non-Mathworks product that does not use "syms".
sir...if it is possible try that problem in matlab..and suggest me the right code because last two-three days i am completely struck that problem, because with that only i can proceed my research problem.
Here is what happens if I try it in MATLAB:
syms f(t) g(t)
syms f(t) g(t)
[f(t), g(t)] = dsolve(diff(f) == 3*f + 4*g, diff(g) == -4*f + 3*g, f(0) == 0, g(0) == 1)
Undefined function 'syms' for input arguments of type 'char'.
This is exactly what is to be expected for people who do not have the Symbolic Mathematics toolbox.

This question is closed.

Asked:

on 24 Jul 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!