Re: Matlab -- Venting, Plus Miscellaneous Questions
- From: "David Wilkinson" <david@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 21 Feb 2006 07:20:09 -0000
Have you looked at MathCad? You just type the equations in directly in
mathematical form as they would appear in a textbook or you would write them
on paper. There are no command lines. Numbers of decimal places shown are
easily set globally from a menu. It even works out the units for you.
"Steven O." <null@xxxxxxxx> wrote in message
news:pt9kv1tccsu6iequ9a1g8svobcuojlo5kt@xxxxxxxxxx
I appreciate the detailed reply, and will look at some of the
additional help resources and online resources you mention.
In general, however, my comment would be that your reply confirms some
of my misgivings. For example, in order to change the number of
decimal places in the output of a symbolic calculation, I -- lazy user
that I am -- I don't want to type in a special command syntax each
time. I want global menu settings (via dialog boxes) that I can use
to set this just once, and have it remain that way.
Matlab is obviously intensively command-driven -- which means, I have
to master a significant number of commands to use it. It's like
learning a programming language, always a time-consuming process.
I prefer software that lets me do as many things as possible via
dialog boxes, popup menus, etc, and this software is apparently not
designed with that in mind. I'm sure it's great for many
calculations, and obviously I'll have to learn something about it for
my class. But for anyone searching the web for info on Matlab, if
they come across this thread, at least they'll have some idea of what
to expect from the software.
Regards,
Steve O.
On Mon, 20 Feb 2006 02:52:56 -0500, "Steven Lord"
<slord@xxxxxxxxxxxxx> wrote:
"Steven O." <null@xxxxxxxx> wrote in message
news:llniv1h7lra4d50bmspigite2nsul5kavb@xxxxxxxxxx
I have just started using Matlab the past two weeks for a class. You
know, sometimes you get a new package of software, and start using it,
and right off the bat it seems pretty intuitive. That doesn't mean
you never have to look in the manual, or check the Help, but most
things that you seem to need appear right at hand on the menus, or on
context-sensitive pop-up menus, etc.
Matlab is not one of those programs. So far, as far as I'm concerned,
it's a total piece of ***, at least in the user-friendliness
category. It may very well be able to do extraordinary math things,
once you know the program well enough. But nothing that I need to do
is readily apparent, and hunt as I might, I can't seem to find the
answers to many (most?) of the questions that I have in either the
print or online documentation. Damn, I hate programs like this, you
waste more energy trying to figure them out than you put into actually
using the piece of crap.
If you have any suggestions for ways that we could make MATLAB more
user-friendly, please let us know. Our usability, documentation, and
development staff are always interested in hearing user feedback. You can
use this form to submit your feedback, or contact technical support if you
have comments/questions that you'd like to speak to someone about in a
more
real-time manner:
http://www.mathworks.com/support/contact_us/ts/ebd/enhance_bug_doc_1.html
Okay, I've vented -- and other buyers, beware -- and now maybe some
users will be good enough to help me with some questions.
1. I want to reduce the number of decimal characters the program
shows. I found how you could do that under Preferences for numeric
calculations, but symbolic calculations keep showing some ridiculous
number of decimal places, I haven't even counted. Is there a way to
fix that? Here's some of what I mean:
There are two ways. To change the number of decimal places to which all
symbolic expression are displayed, use the DIGITS function.
http://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/digits.html
To display a specific symbolic expression to a certain number of places,
use
the VPA function.
http://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/vpa.html
Note that neither of these will work with numeric expressions, just with
symbolic expressions.
EDU>> 2/3
ans =
0.66667 %This is okay.
Yes, this is a normal double precision computation; no symbolic
expressions
involved.
EDU>> eqn = '4/s = (3000 + .033*s + (10^9)/s) * I';
EDU>> Ifr = solve(eqn,'I')
Ifr = 4000./(3000000.*s+33.*s^2+1000000000000.)
The Symbolic Math Toolbox, in which the SOLVE function is included, is
trying to represent the coefficients you entered as close to exactly as it
can.
EDU>> Itd = ilaplace(Ifr)
Itd =
.72133570773394583167815285220228e-3*exp(-45454.545454545454545454545454545*t)*sin(168038.43191529419942502424397894*t)
% This is NOT okay!!!!
The default value for the DIGITS function is 32 digits, and it looks like
that's what is being displayed. [I haven't counted.] Try:
Itd = vpa(ilaplace(Ifr), 5)
You should receive this:
Itd =
.72134e-3*exp(-45455.*t)*sin(.16804e6*t)
2. Matlab does not seem willing to plot symbolic expressions, or to
convert symbolic expressions to regular numeric expressions. Using
the example just above, can anyone tell me how to get the program to
plot "ltd" as a function of time? (FYI, the calculations come up in
the process of finding the time behavior of a simple RLC circuit.)
There are a couple of ways. One is to use the EZPLOT function:
ezplot(Itd, [0 pi]) % EZPLOT the function from t=0 to t=pi
Note that the large negative coefficient of t in the EXP call causes the
function to drop down close to 0 pretty quickly.
An alternate way to plot this function is to substitute values into the
expression using the SUBS function, then call the normal PLOT function.
t = 0:1e-4:1;
Itd_double = subs(Itd, 't', t);
plot(t, Itd_double)
Adjust the increment or contents of the t vector to show the part of the
function that you want to see.
3. If you have a symbolic expression like '4/5*exp(-t)*sinh(t)', how
do you tell Matlab to convert the 'sinh(t)' to it's exponential parts,
and then carry through the multiplication with the 'exp(-t)' term?
There isn't an automated way to do this, but you can call the SIMPLE
function on the expression, then copy the expression that's displayed in
the
simple(exp) section and use the EXPAND function on it.
syms t
s = sym('4/5*exp(-t)*sinh(t)');
simple(s)
% copy and paste part of the result of the SIMPLE call
expand(4/5*exp(-t)*(1/2*exp(t)-1/2/exp(t)))
4. Let's say I do the following:
EDU>> eqn2 = 'x = y + 3'
eqn2 = x = y + 3
EDU>> y=1:2:10;
EDU>> eqn2
eqn2 =
x = y + 3
But wait, that's not what I want! I want a list: 4 6 8, etc. How
do I make that happen? And then on the other hand...
I'm not exactly sure what you want, but I think you can either use SUBS:
eqn2 = 'x=y+3';
y = 1:2:10;
subs(eqn2, 'y', y)
or EVAL:
eqn2 = 'x=y+3';
y = 1:2:10;
eval(eqn2);
x
5. Suppose I now enter:
EDU>> z = y+3
z =
4 6 8 10 12
Okay, that's good... but suppose I want to be reminded of my
definition of z? How do I get that back again, without have to scroll
through the command history?
The way you've defined it, you can't. MATLAB evaluates the expression y+3
then assigns the result to the variable z. If you defined it as:
z = sym('y')+3
then evaluating sym('y')+3 gives you y+3, which gets assigned to z.
6. Is there any way to tell the command history to stay at the
currently highlighted command, rather than autoscrolling to the bottom
each time I enter a new command?
No, not as far as I am aware. That would be a good enhancement request to
fill in the form at the link I posted above.
7. Is there a way to save and restore, not the data, but the
sequence of commands and responses in the command window? So that I
can open the command windows, and fully restore all those commands?
You can either create an M-file and write your commands there, or use the
DIARY function, or (if you're using version 7.0 or later of MATLAB) use
the
publishing functionality of the MATLAB Editor. There are sections of the
MATLAB documentation covering each of these capabilities:
Creating and using M-files
http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/ch5pgmgm.html#14154.
The DIARY function
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/diary.html
Publishing capabilities
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/notebook.html#22454
That's all for now. (I'll spare you my plotting problems, at least
for now.) I'm sure there will be more to follow. I'm looking forward
to hating this program even more as time goes by.
I have a few suggestions. The first five questions you asked were about
the
functionalities of the Symbolic Math Toolbox -- if you were looking in the
main MATLAB documentation for information on those capabilities, you
probably wouldn't have found much. In the Help Browser (which you can
access using the DOC function or the question mark in the toolbar at the
top
of the desktop, among other locations) look at the Symbolic Math Toolbox
documentation instead of the MATLAB documentation when working with
symbolic
expressions.
Secondly, we have written a section of the documentation specifically
targetted to help new users up the learning curve of MATLAB a bit easier.
You might find it easier to understand than the full documentation, as the
full documentation tries to cover both basic functionality and advanced
usage, while the Getting Started documentation helps you, well, get
started.
The online version of the Getting Started documentation for the latest
version of MATLAB is here:
http://www.mathworks.com/access/helpdesk/help/techdoc/learn_matlab/learn_matlab.html
It's also available in your Help Browser
Finally, there's a newsgroup specifically for MATLAB that tends to be
(more
or less) friendly to new users, as long as you don't post a question like
"I
need full code on exactly how to do X [advanced image processing or signal
processing, speech recognition, etc.] for my project! My project is due
in
a week, so send it to me immediately!". The name of that newsgroup is
comp.soft-sys.matlab (often called CSSM by regular readers), and you can
access it from The MathWorks website:
http://www.mathworks.com/matlabcentral/
The plotting function comments/questions/rants that you alluded to would
probably be better suited for CSSM than sci.math.symbolic, and who
knows --
with CSSM's help, you might just find you like (or at least are able to
use
more effectively) MATLAB.
"Spying On The College Of Your Choice" -- How to pick the college that is
the Best Match for a high school student's needs.
www.SpyingOnTheCollegeOfYourChoice.com
.
- Follow-Ups:
- Re: Matlab -- Venting, Plus Miscellaneous Questions
- From: Steven O .
- Re: Matlab -- Venting, Plus Miscellaneous Questions
- References:
- Matlab -- Venting, Plus Miscellaneous Questions
- From: Steven O .
- Re: Matlab -- Venting, Plus Miscellaneous Questions
- From: Steven Lord
- Re: Matlab -- Venting, Plus Miscellaneous Questions
- From: Steven O .
- Matlab -- Venting, Plus Miscellaneous Questions
- Prev by Date: Ideals with polynomially increasing Groebner bases
- Next by Date: where are the signs?
- Previous by thread: Re: Matlab -- Venting, Plus Miscellaneous Questions
- Next by thread: Re: Matlab -- Venting, Plus Miscellaneous Questions
- Index(es):