답변 있음
How to calculate a line-of-best-fit equation (y=mx+b) from a simple x-y dataset, and then to use this equation to calculate r-square?
Approach 1: what Sean said. (Note |corrcoef| gives the correlation coefficient r, not the coefficient of determination r^2) ...

14년 초과 전 | 4

답변 있음
Plot Stress Contours
What are the dimensions of your variables? It sounds like maybe you have vector data? That is, Z, r, and sigma are all n-by-1....

14년 초과 전 | 0

답변 있음
Extracting the value of a slider
Your slider has a |callback| property that defines the function that will be called when the slider is moved. It's *inside that...

14년 초과 전 | 0

답변 있음
Event function with odesolver error
Ah. I think I have an idea now. Check the error message trace. I'm guessing the error actually occurs within |Schrodinger|. ...

14년 초과 전 | 1

| 수락됨

답변 있음
Help with basic MATLAB syntax
Just for Sean: function doodle hf = figure; ha = axes('units','normalized','position',[0,0,1,1],... 'X...

14년 초과 전 | 3

답변 있음
Is it contourplot or Isosurface?
That's a |contour| plot. But if you have vector data, you may need to go through |TriScatteredInterp| and |meshgrid| first.

14년 초과 전 | 1

답변 있음
make replacements in an array
You can't have a matrix of strings 'yes' and 'no', like you've shown. You can have logicals (true/false), but they will display...

14년 초과 전 | 0

답변 있음
Double Prime
If it's just a matter of spacing, you could always remove some space between the primes: xlabel('$G^{\prime\!\prime}$','Int...

14년 초과 전 | 1

답변 있음
mouse button click
The figure has a property |'SelectionType'|. This will have the value |'normal'| for a left-click, and |'alt'| for a right-clic...

14년 초과 전 | 3

| 수락됨

답변 있음
Simulation of charged particle in matlab
Without knowing the math behind what you're trying to simulate, I don't know if it's a problem in the way you've coded up the eq...

14년 초과 전 | 0

답변 있음
How to skip the first line of a text file when reading it?
Given how simple your file contents are, I'd use |dlmread|: M = dlmread('filename.txt', ' ', 2, 0) The last two arguments te...

14년 초과 전 | 10

답변 있음
Multiple initial conditions differential equations
There's no immediate way to do this (AFAIK). Some possible workarounds would be to make a larger system of equations (ie just s...

14년 초과 전 | 0

| 수락됨

답변 있음
axes
I'm guessing you're getting the Code Analyzer warning "Calling AXES(h) without an output in a loop can be very slow. Include 'h'...

거의 15년 전 | 1

| 수락됨

답변 있음
Maximization problem
If I'm interpreting correctly, your v (aka S^2) is recursively defined. So presumably you have some way to determine u(0) and S...

거의 15년 전 | 2

| 수락됨

답변 있음
[DISCONTINUED] Wish-list for MATLAB Answer sections.
Some way to prevent questions being deleted without a good reason! I'm getting *really* annoyed with people whose response to...

거의 15년 전 | 4

답변 있음
Contour plot
Massive hack that works in this case (not sure how generalizable it will be to whatever your application is): a(a==0) = NaN...

거의 15년 전 | 0

답변 있음
How to create a mean bar for individual groups?
Can you clarify what you mean by "x-axis is has two points - smoker and non-smoker". For a scatter plot you need equal-sized x ...

거의 15년 전 | 0

답변 있음
Finding text - Can't locate where specific text is...
I don't know what you're planning to do with this data, but it seems like some of the data types available in Statistics Toolbox...

거의 15년 전 | 0

답변 있음
Best way(s) to master MATLAB?
# What everyone else said. (Especially training & tutorials. Disclaimer: I'm not *entirely* impartial!) # Read blogs like <ht...

거의 15년 전 | 4

답변 있음
kmeans() in MATLAB
As I understand your question, you have a predetermined group numbering and you'd like |kmeans| to adhere to that. |kmeans| use...

거의 15년 전 | 0

답변 있음
Why do you come to "MATLAB Answers"?
why(416) why(9816) Or, failing that, why(22) The first two are actually fairly accurate! In many ways, I gues...

거의 15년 전 | 0

답변 있음
Subtract combinations of variables in a vector
If you have Statistics Toolbox, here's a neat trick (I think this is what you're asking for): % make a vector of numbers ve...

거의 15년 전 | 0

| 수락됨

답변 있음
Control structures
|iskeyword| |doc|

거의 15년 전 | 1

| 수락됨

답변 있음
Simple Solver-type function
If you have Optimization Toolbox, you can use |fsolve|. Rewrite the three equations in the form F(x) = 0, where x is a vector o...

거의 15년 전 | 1

| 수락됨

답변 있음
Ginput in a GUI
Can't find the answer where I shared this before, so I'll just copy-n-paste. This is code that works around the limitations of ...

거의 15년 전 | 1

답변 있음
ode45 - solving 2nd Order ODE IVP problem
Nothing's wrong, except your interpretation of the output. The columns of |output| correspond to y and y' (v), not v and v'. T...

거의 15년 전 | 1

답변 있음
How to suppress messages from function lsqcurvefit?
Have you tried setting the |'Display'| option? opts = optimset('Display','off'); ... = lsqcurvefit(...,opts);

거의 15년 전 | 6

| 수락됨

답변 있음
label individual points in boxplot
You should be able to use |gname|. Depending on how your data is organized, you might need to |repmat| the labels. For example...

거의 15년 전 | 0

답변 있음
Contributors metainfo: reputation and more
Fittingly, time to congratulate the author of this thread. 600 rep for Oleg!

거의 15년 전 | 0

답변 있음
For new matlab/simulink users, do you know about the (interactive) video tutorials?!
Just wanted to mention that a new tutorial was added recently: <http://www.mathworks.com/academia/student_center/tutorials/compu...

거의 15년 전 | 1

더 보기