Answered
Grouped scatter plot with categories (strings) on y-axis (essentially stacked 1-D plots)
I'd go with what you suggest of giving the experiments integer values. Then do set(gca,'YTick',1:n) set(gca,'YTickLabel...

15 years ago | 0

Answered
How to plot these equations as a 3d surface plot?
When you use "j" do you mean the imaginary number (sqrt(-1))? If so, these functions have complex values, so how can you have a...

15 years ago | 2

| accepted

Answered
combined sorting
[sortB,idx] = sort(B,'descend'); sortA = A(idx); Or put the vectors into a matrix and use |sortrows|.

15 years ago | 1

| accepted

Answered
New column
% Read stock data from file fid = fopen('stocks.txt'); data = textscan(fid,'%s%s%f%f%f%[^\n]','delimiter',' ','headerlin...

15 years ago | 0

Answered
File name a function argument
1. the standard approach would be to use a string function y = foo(fname) fid = fopen(fname); etc Then call it wit...

15 years ago | 2

Answered
This problem involves 3 time dependent ODEs that are to be solved graphically with the input of a time dependent function.
When using |ode45|, it will evaluate your function at a given set of values for the independent and dependent variables, so you ...

15 years ago | 0

Answered
matlab code question
The colon in MATLAB is the range operator so |ii:ii+window-1| gives the values |ii|, |ii+1|, |ii+2|, etc, for a total of |window...

15 years ago | 0

Answered
dimensional data string
|polyfit| is finding the least-squares best fit to the data for a quadratic polynomial. |polyval| then evaluates this polynomia...

15 years ago | 0

Answered
solving ODE using runge kutta method
There's really no difference between this and the <http://www.mathworks.com/matlabcentral/answers/3998-solve-an-ode-with-runge-k...

15 years ago | 0

Answered
kstest - normal?
The output is the more likely hypothesis, not a true/false. Hence, h = 0 means the null hypothesis (H0) which is that the data ...

15 years ago | 0

Answered
Navigating a large classdef in the editor?
In the Editor toolbar there is a button that looks like a blue "f()". If you hover over it, it says "show functions". If you c...

15 years ago | 1

Answered
Color a grid by using an intensity matrix
What do you mean "bad results"? Can you explain or show what you're doing? Either way, I'm going to take a guess that the pr...

15 years ago | 1

| accepted

Answered
Plotting Error
Use |figure| to create another plot window

15 years ago | 0

Answered
find function
No. I'm guessing you are getting feedback from either humans or the MATLAB Code Analyzer about using logical indexing instead o...

15 years ago | 2

| accepted

Answered
Urgent: How to merge two datasets of different dimensions ??
Sounds like you want a left outer join C = join(A,B,varname,'type','leftouter','mergekeys',true);

15 years ago | 0

Answered
Creating a 3d surface plot
|TriScatteredInterp| Here's an example (taken from the doc): % Make some fake vector data x = rand(100,1)*4-2; y = rand(...

15 years ago | 1

| accepted

Answered
How can I use a for loop to name multiple variables?
Obligatory answer: <http://www.mathworks.com/matlabcentral/answers/143-how-do-i-make-a-series-of-variables-a1-a2-a3-a10 don't>. ...

15 years ago | 0

| accepted

Answered
solving non-linear function with double integral
How's this: %% Find R g1 = @(x,y,R) 1./(2*pi*sqrt(1-R.^2)).*exp(-(1./(2*(1-R.^2)).*(x.^2-2*R.*x.*y+y.^2))); g2 = @(R) dbl...

15 years ago | 1

Answered
Question about Kmeans function
The |'start'| parameter defines the initial centroid locations. As the help explains, it should be k-by-p where k is the number...

15 years ago | 0

| accepted

Answered
Import worksheet in excel
[~,sheets] = xlsfinfo('test.xls') Then compare |sheets| to |lab| using set operations (eg |ismember| or |intersect|)

15 years ago | 0

| accepted

Answered
Fonts with latex interpreter and no interpreter look different
You can use the 'latex' interpreter option on the axis labels: xlabel('hello world','interpreter','latex') Do you mean the a...

15 years ago | 7

| accepted

Answered
get data from cell
|A{:}| will extract all the contents. However, the result will be in the form of a list. If the contents are all different siz...

15 years ago | 0

Answered
Inner matrix dimensions must agree HELP
In the middle of that line you have (1-((2*x)/pi))*((sin((pi/4)-(x/2)))).^2 That should be an array multiply (.*), not ...

15 years ago | 1

Answered
Jacobian Matrix of partial derivatives of a nonlinear system
Here's a f.d. Jacobian function I threw together: function J = fdjacobian(f,x,dx) y = f(x); m = length(y); n =...

15 years ago | 0

Answered
Jacobian Matrix of partial derivatives of a nonlinear system
Yes, you can use any standard finite difference approximation to get a Jacobian, so H(i,j) = diff(output(i))/diff(input(j)) woul...

15 years ago | 0

| accepted

Answered
Please help me transform Jacobi into Gauss-Seidel
So you keep a copy of |x|, called |xold|, which you use to calculate the new values of |x|. The main part of the algorithm happ...

15 years ago | 0

Answered
How to store 5 or 6 files output into same excel file
Do you know <http://www.mathworks.com/matlabcentral/answers/3781-how-can-i-store-multiple-data-into-same-excel-file Sandeep> by ...

15 years ago | 0

| accepted

Answered
Regarding 3D plots with Matlab
So what kind of visualization do you want at the end? Do you want a surface? In which case you could do something like x ...

15 years ago | 0

| accepted

Answered
Regarding 3D plots with Matlab
I'm not sure I understand what you're after. It sounds a bit like plot3(parameter(1),parameter(2),Number,'o')

15 years ago | 0

Answered
bar graph
Rather than use |hold|, why not do h = bar(1); axis(...) outside the loop, then in the loop do set(h,'YData',i)

15 years ago | 0

Load more