How can I input variables to dsolve?

I'm writing a function using dsolve, and earlier in the function I request input from the user at the keyboard, and save this input to the variable "A". When using dsolve, I cite the variable "A", but dsolve's solution leaves in the letter A instead of replacing it with the numerical answer the user provides. How can I fix this? Below is my code. I've tried using syms but I'm not sure how to make it work.
A=input('Enter the initial amount of the parent:');
Q=dsolve('DQ=(-1)*L*Q','Q(0)=A','t')
%The output is: Q = A/exp(L*t)
%I want A to take on the value that the user enters at the keyboard (for example, 7). Please help!

回答 (1 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

質問済み:

2013 年 2 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by