From: Vladimir on 5 Jul 2010 05:59 Hello, first of all this is my first post in this Newsgroup but I found lots of solutions to problems I run up since I started using MATLAB. What I'm about to ask might be too easy but anyway here is my question: I wrote function for solving Laplace diff equation and it works like a charm, but is there a way to have values already calculated/input shown in dialogue text when using INPUT command?? f.e. I'm calling function like [x,y,U]= Laplace(xvalue,yvalue,Dx,Dy) where xvalue and yvalues are upper boundaries of space where I'm looking for solution (0<x<xvalue, 0<y<yvalue) Now, I'm using input command to have dialogue text popped out for user to input boundary values for u(x,0), u(x,yvalue), u(0,y) and u(xvalue,y) like cond2=input ('Input 2nd boundary condition for u(x,A)= ','s'); and so on where A should be yvalue. Is there anyway to change A with numerical value of yvalue I used to call the function in first place?? (f.e. [x,y,U]= Laplace(1,2,0.1,0.05) .... so I could get Input 2nd boundary condition for u(x,2)= ) thanks in advance
From: Walter Roberson on 5 Jul 2010 09:25 Vladimir wrote: > but is there a way to have values already calculated/input shown in > dialogue text when using INPUT command?? I am not confident I know what you are asking, but instead of cond2=input ('Input 2nd boundary condition for u(x,A)= ','s'); you could have cond2=input (sprintf('Input 2nd boundary condition for u(x,%g)= ',A),'s');
From: Vladimir on 6 Jul 2010 04:27 Walter Roberson <roberson(a)hushmail.com> wrote in message <O2lYn.6772$Hw.6491(a)newsfe10.iad>... > Vladimir wrote: > > but is there a way to have values already calculated/input shown in > > dialogue text when using INPUT command?? > > I am not confident I know what you are asking, but instead of > > cond2=input ('Input 2nd boundary condition for u(x,A)= ','s'); > > you could have > > cond2=input (sprintf('Input 2nd boundary condition for u(x,%g)= ',A),'s'); Thank You very much, that worked perfectly and that is exactly what I need!!!
|
Pages: 1 Prev: Database connectivity Next: Monte Carlo Simulation HELP! |