Answered
Set an empty cell array equal to zero.
Actually, the cell array itself is _not_ empty, it holds an empty array. And, empty isn't a string value anyway so that compari...

11 years ago | 0

| accepted

Answered
converting from fortran code to matlab
'$' isn't a legal Fortran character (nor is it allowed in a Matlab variable name); you'll have to fix that up. I don't know whe...

11 years ago | 0

Answered
Group-wise mean in multi-dimentional array
_"cell array of the dimension 1 x 121 x 515. It represents 515 sets of 1 x 121..."_ First, why the complication of a cell arr...

11 years ago | 0

| accepted

Answered
Display Error message limit of chars
You've misdiagnosed the problem. The issue isn't the internal message is too long, it's that you've displayed the _*MException*...

11 years ago | 0

Answered
Is this works in Matlab?! K = (N==INFECTED_A1) + (E==INFECTED_A1) + (S==INFECTED_A1) while INFECTED_A1=1. How can I get K=3?!
Have to use paren's to get proper precedence-- K =(N==INFECTED_A2) + (E==INFECTED_A2) + (S==INFECTED_A2);

11 years ago | 0

| accepted

Answered
Finding values on a graph
If you plotted the two graphs, you already have the values; why isn't it simply dyEnd = y2(end) - y1(end); % ?? In ...

11 years ago | 0

Answered
Looking within search path for a directory containing a chosen string
Probably not a whole lot unless... _*IF*_ the subdirectories were to be on a given higher level path branch, then one could p...

11 years ago | 0

| accepted

Answered
Selecting rows from a file starting with a letter followed by 3 numbers
Indeed, per the doc for *strcmp* and friends, they "know nuthink!" about regular expressions. Use *regexp* instead. if reg...

11 years ago | 0

Answered
Power Regression - Matlab vs Excel
Didn't show your work in Excel so can't judge what went on there, but I don't know why you'd choose that model over the Matlab r...

11 years ago | 0

Answered
Read multiple excel files in matlab and combine them in one file
Nothing particular to it; simply read the two file sequences into separate variables and merge those as desired. It isn't clear...

11 years ago | 0

Answered
xlsread with range of a column from specific row till the end
There is no Excel syntax expression equivalent to Matlab _:end_ array references, no. Read the column and trash the unwanted ...

11 years ago | 1

| accepted

Answered
How to restrict the Max Peak Height of findpeaks
You're correct there is no such facility built into *findpeaks*--one would normally think a large peak would be _agoodthing(tm)_...

11 years ago | 0

Answered
Write a function that displays the next day when you input the previous day in vector form i.e. [mm dd yyyy]
A beginning...first use some variables that make some mnemonic sense... function [m d y] = next_day(m, d, y) d=d+1; %...

11 years ago | 0

Answered
Selecting rows from a file starting with a letter followed by 3 numbers
Not much can do w/o data file, but you can do what we can... doc debug Set a breakpoint and work thru the function to se...

11 years ago | 0

| accepted

Answered
How to normalize measured data?
Unless the timing is grossly out, probably doc interp1 is about as good a job as you can do.

11 years ago | 0

| accepted

Answered
how to plot winter rainfall data with trend line
y=[78:81].';r=[17 29 8 4].'; plot(y,r) b=polyfit(y,r,1); rhat=polyval(b,y); hold on,plot(y,rhat,'r') set(gca,'x...

11 years ago | 0

Answered
How do I pas one scalar from a function that outputs an array?
Is no Matlab syntax to do that directly; use an intermediate temporary variable to hold the result. If _must_ have a function...

11 years ago | 0

Answered
Make subplot span across multiple slots
Sure, just save a handle as there's not a unique number for any of 'em if do it this way...as long as you don't overwrite an exi...

11 years ago | 6

| accepted

Answered
Import data from several .xlsx and different columns
Looks way too complicated -- something like [~,txt]=xlsread('C:\...\reference.xlsx'); for i=1,size(txt,1) C1C2=[txt...

11 years ago | 0

| accepted

Answered
Create for loop to read in multiple excel files
See the FAQ <http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F How can I process a sequence of files?> ...

11 years ago | 0

Answered
Solve 1-(0.955.^n)-(0.005.^n)*(0.995.^(n-1))*n-(0.005.^2)*(0.995.^(n-2))*n*((n-1)/2)= 1/2 numerically with matlab
fh=@(n) 1-0.955.^n-0.005.^n.*0.995.^(n-1).*n-0.000025.*0.995.^(n-2).*n.*(n-1)/2- 0.5; NB: n.*(n-1)/2, _not_ n(n-1)/2

11 years ago | 0

Answered
Creating a Matrix that is a manipulation of another matrix
A(:,2)=-A(:,2); % negate elements in original or A(:,2)=-1*A(:,2); or B=[A(:,1) -A(:,2}]; % new array keepin...

11 years ago | 0

| accepted

Answered
Trouble Using Hold for Plots
As written, there's no dependency on _r_ (and should to preallocate X for full size to save overhead on dynamic allocation if re...

11 years ago | 0

Answered
I'm complitily lost with that error: Error using horzcat Dimensions of matrices being concatenated are not consistent
N = 20; ... B = 4.0*pi*EO*ER*VO*ones(N,1); % size(B)--> [20,1] C = inv(A); % size(A)--> [20,20]; ergo size(C)--> [...

11 years ago | 0

| accepted

Answered
Any way get the filename into my print-command?
As you've written it, you're reading from 'FILENAME' as a fixed text string. You have all sorts of other options from having a ...

11 years ago | 0

Answered
using one fprintf statement to display multiple numbers?
Study the example at doc fprintf % "Write Table to Text File" link _carefully_. The answer to your problem is hidden the...

11 years ago | 0

| accepted

Answered
Append varying length vectors to csv file using dlmwrite
There really is no way to produce A) above by two sequential writes of the data in columns 1:3 and 4:5 separately--sequential fi...

11 years ago | 0

Answered
Trim a dataset based on array of subject IDs that correspond to rows to keep in matrix
b=a(ismember(a,list),:); % see doc ismember for details

11 years ago | 0

Answered
For Loop in Command Window Not Working - But Code Works Line-By-Line?
_L7_ is just a character string; what do you expect of a convolution of it with an (assumed) data file returned as _s_? Seems t...

11 years ago | 0

| accepted

Answered
How to write a loop to count the number of instances of a certain number occurring in each row?
Use the second, optional argument to sum-- s=sum(m==2,2); % doc sum for details...

11 years ago | 0

| accepted

Load more