Answered
X Y Z Surface Plot Problem
data = xlsread('filename.xlsx'); % read in everything (numeric) t = data(1,2:end); % first row (except firs...

14 years ago | 1

| accepted

Answered
matlab certification
Ask and it shall be given unto you: There is now a new answer to this queston: yes. In case you missed it: *yes*. And to cl...

14 years ago | 9

| accepted

Answered
Changing function with Iteration
So you have a bunch of functions called |ArithOper1.m|, |ArithOper2.m|, |ArithOper3.m|, etc? If there's a small enough number o...

14 years ago | 0

| accepted

Answered
choose two coordinates
idx = (y == mode(y)); x(idx) y(idx) or, if x and y are columns of a matrix idx = (xy(:,2) == mode(xy(:,2))); ...

14 years ago | 0

| accepted

Answered
assign input to variable name
Generally this isn't a great idea, but if you want to, you can use |eval|. First make a string of the command you want to issue...

14 years ago | 0

Answered
reason for this error??
i_close =(gi,se2); This isn't valid MATLAB. Should there be a function call here, or are you trying to concatenate? Eg ...

14 years ago | 1

| accepted

Answered
eigen values of 3D matrix
I have suggestions how to do it without the |for| loop, but not in a way that will speed things up! :) Making a block diagonal...

14 years ago | 0

Answered
Character array with one letter
Easy char(46*ones(size(cha))) Not so easy regexprep(char,'\w','.') :)

14 years ago | 0

Answered
plot3+color
Sorry, just noticed this hasn't been answered for some reason. Simplest solution is to make a scatter plot rather than a line p...

14 years ago | 3

Answered
Sorting NaN
As long as you don't have any |-Inf| values in |a|, you could always do a quick hack: a=[1 2 3;4 5 6;7 8 9;NaN NaN NaN] ...

14 years ago | 4

| accepted

Answered
Simple reformat data question
How much does this need to generalize? If |a| might be very long, using a transpose is inefficient. Will the number of element...

14 years ago | 0

Answered
How to put Matlab variables into dos command
Do you want to pass the *value* in |matlab_variable| in the dos command? That is, if |matlab_variable = 42|, you're trying to i...

14 years ago | 1

Answered
Conditionally Format Bar Chart
Not sure if I understand your comment exactly, but it sounds like you have x & y data, then another variable z(x) that is +1 or ...

14 years ago | 1

Answered
loop intial guesses in fsolve
Works for me. Some possible reasons for your error: |p| is already defined in your workspace, in a way that doesn't allow the a...

14 years ago | 1

| accepted

Answered
batch reading of xls files
Any array in MATLAB must have consistent dimensions, so if you really want a 3-D array of numbers (doubles), you would have to p...

14 years ago | 0

Answered
use matrix, premutation?
I think this is what you're after: c=[1,2,3,4,5]; cp = perms(c); % 0*c1, 72*c2, 144*c3, 216*c4, 288*c5 allc = bsxf...

14 years ago | 3

Answered
Menu Gui - how to have the menu box always displayed
Unfortunately [voice = Morbo] |menu| does not work that way [/voice]. There are two alternatives I can think of: 1) use |menu| ...

14 years ago | 0

| accepted

Answered
Appending two or more .mat files
If I interpret your question correctly, you have two MAT-files containing the same variable names, but with different data, and ...

14 years ago | 2

| accepted

Answered
combine date & time
What class are |day| and |time|? If they are char arrays, then: ns = datenum(strcat(day,32,time)); If they are cell arr...

14 years ago | 1

Answered
How to access displayed axis limits when scaling is logarithmic and data partly negative?
A hack would be to use the |YTick| values instead, as there's always a tick at the top and the bottom by default. yl = get(...

14 years ago | 0

Answered
??? Reference to non-existent field 'matlab'.
A shot in the dark, but... your filename isn't something like |myfile.matlab.m| is it...?

14 years ago | 1

Answered
Single line string find
find(strcmp(test,data))

14 years ago | 0

| accepted

Answered
How do I use an array of files?
Strings in MATLAB are treated as a matrix of characters. Hence, fname = ['Specimen_RawData_1.xls','Specimen_RawData_2.xls'...

14 years ago | 0

Answered
Distance between two points - use ginput!
Just because I can, here's a one-line version: d = sqrt(sum([diff(reshape(xy(1,:),2,[]));diff(reshape(xy(2,:),2,[]))].^2)) ...

14 years ago | 0

Answered
sobel
This doesn't seem to be any MATLAB Toolbox function, nor anything on the File Exchange. So I'm assuming this is code you've inh...

14 years ago | 0

Answered
wind_rose execution
It looks like you're using a File Exchange submission called <http://www.mathworks.com/matlabcentral/fileexchange/17748-windros...

14 years ago | 0

| accepted

Answered
Setting matrix with functions or for loop
How general does this need to be? And why do you want to use a loop specifically? This does what you're asking, and would gene...

14 years ago | 0

| accepted

Answered
rename a variable
Let me see if I interpret the question correctly: you have filename = 'bob'; data = [1,2,3]; And you want to rename |...

14 years ago | 2

| accepted

Answered
Finding an average curve
When you say "find the trendline of each curve" I assume you mean that you have several sets of (x,y) data and you're doing a (l...

14 years ago | 0

| accepted

Answered
Accessing data from a file and putting it into a matrix in Matlab, plus headers.
Is this correct? Basically, yes. When you call the function, |header| should be a cell array of strings, so writeWithHead...

14 years ago | 0

| accepted

Load more