Answered
Finding Time Intervals with corresponding data
_"1 means the switch is on, 0 means the switch is off. ... If I could find the beginning value and ending value of each time int...

11 years ago | 1

| accepted

Answered
Simulating Fortran common blocks with a nested function in Matlab.
_"...approaches for dealing with Fortran code with a lot of common blocks and transferring it over to Matlab."_ My first plan...

11 years ago | 0

| accepted

Answered
how to make a function whose first input argument is a cell vector (row or column) of strings and whose second input argument is a string.
Against better judgment but since Walter's already posted one solution, for the original problem description the suggested appro...

11 years ago | 0

Answered
x-axis on plot has cushion to left and right (i.e. plot doesn't start at beginning, and ends early with remaining space in the chart
*datetick* unless told differently via *keeplimits* uses an internal rounding alogrithm to pick the axes limits to make what it ...

11 years ago | 0

| accepted

Answered
Getting an error of "Not enough input arguments."
Your sample line invokes your function *firfilt2* with no arguments. Not sure why you did that...otherwise, looks like the samp...

11 years ago | 0

Answered
Best Practice for Testing for Appropriate Numerical Input
*isfinite* removes the NaN and Inf possibilities *isreal* tests whether is a complex nonzero imaginary part

11 years ago | 0

| accepted

Answered
converting a file by referencing a dll for format (or calling a program to open and save as)
Looks like these folks have a batch converter that should be able to make work... <http://www.essentialftir.com/fileConversio...

11 years ago | 0

Answered
Keeping check of how many times a loop has seen a repeated value
I think your counting is off by one in that you need the initialization to be zero until do the counting...consider >> hist...

11 years ago | 1

Answered
How to create a random number as i asked below.
doc randperm

11 years ago | 2

Answered
I could not understand why this part of a code gives error "Undefined function or variable 'normalise'". Can you please figure out for me?
There is no TMW-supplied function *normalise* nor *ridgesegment* so if you got the above function from some other place then per...

11 years ago | 0

| accepted

Answered
How to plot harmonic components of a sine wave
To plot versus the harmonic number you first must determine what the fundamental frequency of the signal is (either in Hz transf...

11 years ago | 1

| accepted

Answered
Date String to x-axis on Plot, Date and Time on Plots
Which release? If late, see <http://www.mathworks.com/help/matlab/matlab_prog/plot-dates-and-durations.html plot-dates-and-d...

11 years ago | 0

Answered
searching for elements and deleting them in an array
ix=any(imag(x)~=0 | x==0,2); x(ix,:)=[]; You can, of course, combine the logical expression into the subscript and thu...

11 years ago | 0

Answered
How to slove this scatterplot error
It appears to be the Communications Toolbox *scatterplot* in which case according to the doc (and consistent with the error), a ...

11 years ago | 0

| accepted

Answered
How to control lines in the legend?
AFAIK, all you can do is save the object handles (the optional return values) when you create the legend and then set properties...

11 years ago | 0

Answered
Writing headings AND data with the xlswrite function
Per the doc for *xlswrite*, the information written must be _"... specified as a two-dimensional numeric or character array, or...

11 years ago | 0

Answered
How do i find values from a fitted curve Matlab Curve Fitting?
Use the Save To Workspace option for the fit...it's not all that intuitive of an interface I agree...then you get a fit object w...

11 years ago | 0

Answered
Is it not possible to change every font size on plots at the same time?
Nope; they're individual properties of the various objects. You could do some building of some tools and/or link various proper...

11 years ago | 0

Answered
Loading multiple .mat or Excel files and maniplulate them in a double for loop
fr=bxsfun(@rdivide,fractions,sum(fractions,2)); % ratios for i=1:N % get the three arrays load ['var' int2str(i)]]; ...

11 years ago | 0

Answered
Reading an Array in scientific notation from a txt
d=textread('yourfile.dat','headerlines',2); While *textread* has been deprecated to 'red-haired stepchild' status, it's ver...

11 years ago | 0

| accepted

Answered
Most efficient method for extracting subsets of Excel data
I'm virtually certain with *xlsread* as you've found that the reading a full sheet and decimating in memory will always win. Yo...

11 years ago | 0

Answered
How do I create a for-loop that can read binary files of different/unknown sizes?
If there's only the one set of data been written to the file, then you don't need to know how big it is at all, simply use ...

11 years ago | 0

Answered
How to save everything except one or two given variable?
If you can write either # a wild card expression or # a regular expression that returns everything excepting those you d...

11 years ago | 0

Answered
find the probability in normal distibution
Approximate (to nearest point of x vector) is fairly simple to do. Define f=@(x)normpdf(x,mu1,s1)-normpdf(x,mu2,s2) as ...

11 years ago | 0

| accepted

Answered
Problem with import date data
Per the doc for *dlmread* _"All data in the input file must be numeric. dlmread does not operate on files containing nonnumer...

11 years ago | 0

| accepted

Answered
who i can extract which row hasn't 'NaN' vector
See doc isfinite % instead or ~isnan() You've written an expression for an individual element of _dmii_ unless _sac_...

11 years ago | 0

| accepted

Answered
difficulties with basic syntax in array subsetting
for i=151:length(full_array) if binary_vec(i) spike_vec = response((i-150):i) end end Your code had two...

11 years ago | 0

Answered
How to read variables from one file in another file?
Read the "Getting Started" tutorial of scripts and functions -- you pass arguments into functions and return results as return v...

11 years ago | 0

Answered
How specific lines in a text file can be updated many times ?
Simple answer is "you can't, at least easily". Sequential text files are, well, "sequential". Even with the complex ways you c...

11 years ago | 1

| accepted

Answered
How to use IF equation in Matlab instead of Excel?
Caution: "Air code", untested... d=diff(D); % the demand differences to use first... ix=bsxfun(@eq,P(2:end),D(2:end));...

11 years ago | 0

Load more