using char as formula inside a script

1 vue (au cours des 30 derniers jours)
Kobi
Kobi le 6 Fév 2014
Modifié(e) : Wayne King le 6 Fév 2014
hi, i'm trying to use this character (as seen in the code) as a formula inside a script my main goal is to use this data and to place x=2 and to see the resault of the cos(2)
my code:
clear all close all clc
% integral solver
syms x
funct=sin(x);
answer=int(funct);
answer=char(answer);
x=2;
a=answer(1:length(answer))

Réponse acceptée

Wayne King
Wayne King le 6 Fév 2014
Modifié(e) : Wayne King le 6 Fév 2014
What about just using subs (and you must mean -cos(2) not cos(2))
syms x
funct = sin(x);
intgl = int(funct)
finval = subs(intgl,x,2)
and then if you wish
char(finval)

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by