If you are asking this question, girlfriend REALLY should be reading the acquiring started tutorials - the Onramp tutorials room a an excellent place come start. Over there are additionally multiple MATLAB tutoring sessions ~ above Youtube come watch.
Finally, when you obtain an error. Then display what friend did. Present the finish error message, thus every little thing in red. Otherwise we have to make wild guesses as to what girlfriend did wrong.

You are watching: How to square in matlab

Incorrect dimensions for raising a procession to a power. Inspect that the matrix is square and the power is a scalar. To

Doing Onramp sounds choose a an excellent suggestion for. It yes, really is a couple of hours fine spent. You will certainly be guided through the basics of Matlab. It must teach girlfriend why friend are listed with the equipment you review here.

As Rik says, friend really have to read the tutorials. They assist you to acquire started. Exactly how else will you learn?
As i said, if the variable x is not a scalar, then you need to be careful when making use of ^ come square the facets of x. It won"t perform as you want. In fact, it will reason an error. The error willl it is in the one friend got.

Well i understand the basic of matlab however when i obtain x=0:0.1:1.9 the need to have actually f(x)= x^2 exp (-x/3) it does no work... I have tryed both techniques of hwo to whright squered but nothing workers...

I have the right to assure you that it walk work, IF you usage the suitable operators. Keep in mind that in order come multiply two vectors, again, element-wise, you need to use the .* operator. The course, girlfriend would have learned this, had actually you tried analysis or watching the numerous sources of tutorials that room available. That is yes sir to check out the manual.
In both cases, they work quite nicely. Now were girlfriend listning when I explained how to multiply vectors? What operator do you usage to main point the facets of both vectors? for example, you can write x.^2 in an additional way, using x.*x. This would properly square every element in the vector x.
What if you wanted to main point x with exp(x), wherein x is a vector? What operator would certainly you use? just how does that affect what you want to do?
That is, think the it prefer this. You want to kind x^2*exp(x/3). But x is a vector. Therefore we already know how to square the facets of a vector.
How about exp(x/3)? you can always divide a vectror by a scalar, for this reason x/3. The result will it is in a vector, right?
So now, friend should have actually learned how to multiple a vector (x.^2) through the aspects of the other vector exp(x/3)? What execute you write?
What perform you think? watch in the second code section in his comment. Why room you ignoring everything he says?
And why carry out you refuse to usage the documentation or any kind of of the tutorials and videos friend may discover online?
thanks this is called learing, no soing wherein i look at on youtube and then get confuesed and also still not know it i rath have actually some walk throught it through me on to on...
I dont ns think it additionally usfall yet when i have a quetion so persicfic for matlab then it wont help....
Its prefer the maths ingredient i have to do over there is tutrials to go throught but nothing for the concern you require so i then get confued and lose hope
Honestly, ns think you are providing up, not trying. The is just too overwhelming because that you, therefore you offer up before you ever before start. Then you just ask someone to create the password for your assignments. You won"t find out that way. So shot this:
What one heat of password would have you main point the vectors x and y? I"ve already told you just how to carry out it. So try it. Present me the you want to learn. And then we have the right to take the following step, building up what you have to do to obtain a solution.
John and Rik both said that you job-related through the MATLAB Onramp tutorial and also I agree with that suggestion. It is around a two hour long cost-free course v videos and also hands-on exercises that are immediately scored (so you acquire feedback about whether her answer is correct best away) and is designed to teach friend the basics of working with MATLAB. I doubt after taking sections 4 and 6 friend will understand the difference between the ^ and .^ operators and be able come answer her question.
To advanced each aspect of selection (the variety need no be square or also 2-dimensional) to a power use the .^ operator.
Error utilizing ^ (line 51)Incorrect dimensions for increasing a procession to a power. Examine that the procession is square and the strength is a scalar. To execute elementwise matrix powers, use ".^".
If you"re questioning if you have the right to email me directly, I"m on vacation for the next week or for this reason (only sporadically check Answers.) Posting your follow-up questions as comment on this write-up (or as new posts, if they"re unrelated to this topic) will let others answer more quickly than I will.
Alex, why won"t friend ask questions here so all of can benefit from the conversation (like Steven especially said)? most volunteers right here don"t choose offering free, exclusive consulting via email once the 2175forals.com checked out all this trouble to set up this quite forum because that everyone"s benefit. Besides, other civilization are helpful too. Us volunteers variety anywhere from civilization who simply provide you the price outright, to those choose John who shot to guide you to the answer so the you discover it more deeply than simply being handed one answer. Also though John and also Steve"s strategy may not be the more quickly today, if you discover MATLAB, you will be much faster in the future and also won"t need to ask. Indeed, hopefully you"ll be the expert one day and also be helping rather here.

Community treasure Hunt

Find the prizes in MATLAB central and find how the community can assist you!

start Hunting!

An Error Occurred

Unable to finish the action because of changes made come the page. Reload the page to view its updated state.

pick a net Site

Choose a web site to get translated content where accessible and see neighborhood events and offers. Based upon your location, us recommend that you select: .

select web site

How to Get finest Site Performance

Select the China site (in Chinese or English) for best site performance. Other 2175forals.com nation sites are not optimized for visits from your location.

See more: Holger Mueller On Twitter: " When Airline Ceos Try The Cheap Seats Are Today


Accelerating the speed of engineering and also science

2175forals.com is the leading developer the mathematical computing software for engineers and also scientists.