Answered
loop for scatter plot
Like this? plot([A,A,A],[B,C,D],'o') *EDIT* Based on your comment, here's a new answer: allX = [A,A,A]; allY = [B,C,D];...

15 years ago | 0

| accepted

Answered
Multi-variable minimization
What do you mean by "the minimum variables"? |x| is a vector, so what are you trying to minimize? All the x values? The norm ...

15 years ago | 0

Answered
Newton Raphson method
# Please format your code to make it more readable # Why do you want to display the iterations? But either way, just add a |di...

15 years ago | 0

Answered
Problem with my Code?
That message generally means that your function file isn't on the MATLAB path. Is Newton.m in your current directory? There ...

15 years ago | 0

Answered
Matrix visualisation with coloured box and numbers
|imagesc| and |text|. If it's like sudoku in that the range of values is fixed, use |image| and a custom |colormap|. *EDIT TO ...

15 years ago | 1

Answered
column into row
xcol = xx(:); Although, if you want to go by rows, transpose |xx| first.

15 years ago | 0

Answered
Graphical input from the grid - similar to game of life
|image| or |imagesc| with a custom three-color |colormap| to make the image, then |ginput| to get the point (and |round| as nece...

15 years ago | 0

Answered
how to load and calculate data from a file?
If |x| is a vector of 21 values (and all the other values are scalars), then all you need to do is idk=Is*(exp(x/(m*VT))-1)...

15 years ago | 0

| accepted

Answered
How to get a an XY plotted curve to match another curve based on observed values?
Sounds like a regression/curve fitting problem? The right function to use depends a bit on the form of the model. If it's just...

15 years ago | 0

Answered
Validation of a date with a given format
fmt = 'dd mmm yyyy HH:MM:SS.FFF'; dt = []; while isempty(dt) x = input(['enter date string in ',fmt,' format: '],...

15 years ago | 2

Answered
matlab data parsing help- pulling only certain characters
You could use |regexprep|, but you could also modify your |textscan| format specifier to "notice" but not read these in the firs...

15 years ago | 0

Answered
Matrix help
If it's just a matter of how it's displayed: fprintf([repmat('%4s ',1,16),'\n'],C{:}) (Note, you normally need to trans...

15 years ago | 0

| accepted

Answered
Sum and average even numbers
Why bother? The answer is |-Inf|. Your teacher needs to write more precise questions.

15 years ago | 3

Answered
nice boxes for great linewidths
From my experiments, it appears to be a combination of what Matt Fig said, and just the translation to png. This worked OK for ...

15 years ago | 1

Answered
dlm read error in data import - alternatives?
Give this a try function windcan fprintf ('See http://climate.weatheroffice.ec.gc.ca/climateData/canada_e.html \n se...

15 years ago | 0

| accepted

Answered
3D Plotting with Vectors and Meshgrid
There are times when, much as I love to mess with matrices and/or |bsxfun|, a |for|-loop is just the easiest way to go: Z = z...

15 years ago | 1

| accepted

Answered
dataset
x = dataset('file','simple.txt','delimiter',' ') x.Properties.VarNames x.a plot(x.a,x.b,'o-')

15 years ago | 1

Answered
fitting lognaormal distribution with constraints
The lognormal distribution has two parameters (mu & sigma). If you impose two constraints (namely that the fitted distribution ...

15 years ago | 1

| accepted

Answered
Write a program that calculates sum of the integers numbers
disp(240) Or, for pedants who claim that evaluation is not the same as calculation, disp(239+1)

15 years ago | 1

Answered
ODE45
You do not have to write a function file, but you do have to define a function. You've defined |y1| to |y4| as numeric variable...

15 years ago | 0

Answered
Numerical solution of integral equation with parametric variable
A variation on Jarrod's approach, using function handles (because everyone loves function handles): myFunc = @(t,b) exp(t*b...

15 years ago | 1

Answered
system of odes
The problem is your argument list for |fxx|. ODE functions should be functions of the independent variable, then the dependent ...

15 years ago | 1

| accepted

Answered
Contributors metainfo: reputation and more
For once I get to scoop Walter: *Congratulations to Walter R for successfully avoiding any Y2K issues in rolling over to the ...

15 years ago | 0

Answered
Plot different classes in different colors
<http://www.mathworks.com/help/toolbox/stats/gscatter.html |gscatter|> doesn't do what you're looking for?

15 years ago | 1

Answered
Doubt math
OK, to expand on the cyclist's answer: # rewrite your equation in the form f(I) = 0: ICC - IR.*(exp((V1+Rs*I)./(m.*VT))-1) - ...

15 years ago | 0

| accepted

Answered
Problem only reading in select data
On the off-chance Walter's approach doesn't work (eg there are more than two block formats in the file), here's a more brute-for...

15 years ago | 1

| accepted

Answered
Error in the loop
The problem is that |Z1| is the median of |x|, and |x| has an even number of elements. In that case, the median is the average ...

15 years ago | 0

Answered
steady state criterion
By "steady state" do you mean an equilibrium solution, or some non-equilibrium state that the solution settles to after an initi...

15 years ago | 3

| accepted

Answered
Error in the loop
Well, the obvious answer is basically what the error message is saying: |x| only has 132 elements, but you're looping |j| up to ...

15 years ago | 1

Answered
Problem in defining a column
OK, this is the follow-on to <http://www.mathworks.com/matlabcentral/answers/3766-new-column this earlier question>, right? So ...

15 years ago | 0

Load more