Respondida
Is there a reason MuPad doesn't find the obvious cancellation?
I'm guessing it's something to do with assumptions about squares and square roots, and maybe denominators. Wouldn't swear to it...

más de 15 años hace | 1

| aceptada

Respondida
Black pixels to white
x = imread('street1.jpg'); figure image(x) idx = all(x==0,3); x(repmat(idx,[1,1,3]))=255; figure image(x) ...

más de 15 años hace | 0

Respondida
Faster than ODE45
|ode23tb| is more efficient for cruder tolerances, so make sure you use |odeset| to set the tolerances appropriately. |RelTol| ...

más de 15 años hace | 0

| aceptada

Respondida
Finding 2 independent input variables that provides mimimum of a function
Given that |blackbox| is a function of two variables, why not do some visualization to see what it looks like? x = linspace...

más de 15 años hace | 0

Respondida
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) ...

más de 15 años hace | 4

Respondida
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....

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

Respondida
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|. ...

más de 15 años hace | 1

| aceptada

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

más de 15 años hace | 3

Respondida
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.

más de 15 años hace | 1

Respondida
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...

más de 15 años hace | 0

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

más de 15 años hace | 1

Respondida
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...

más de 15 años hace | 3

| aceptada

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 10

Respondida
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...

más de 15 años hace | 0

| aceptada

Respondida
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'...

más de 15 años hace | 1

| aceptada

Respondida
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...

más de 15 años hace | 2

| aceptada

Respondida
[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...

más de 15 años hace | 4

Respondida
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...

más de 15 años hace | 0

Respondida
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 ...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

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

más de 15 años hace | 4

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

Respondida
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...

más de 15 años hace | 0

| aceptada

Respondida
Control structures
|iskeyword| |doc|

más de 15 años hace | 1

| aceptada

Respondida
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...

más de 15 años hace | 1

| aceptada

Respondida
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 ...

más de 15 años hace | 1

Respondida
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...

más de 15 años hace | 1

Cargar más