Answered
i'm trying to disply ht vs time in a plot, but the graph is ending up blank, what am i doing wrong.
Several issues...first, how are you trying to use the function? If you call it in a loop over some time interval with individua...

10 years ago | 1

| accepted

Answered
naming matrix with a specific pattern
Possible but _a_very_BAD_idea_(tm) indeed. How are you going to write the consumer of this function if you have 50 separate out...

10 years ago | 1

Answered
How to use loop function to find the 1st to Nth elements' average, and then 2nd to Nth element's average? Thanks
Navg=120; % number for moving average krnl=ones(N,1)/N; % convolution kernel over N...

10 years ago | 0

| accepted

Answered
How to find which column consists character 'example' in cell c{1,2}(:,1)
So many possibilities of how things can be stored in cell arrays likely need a small example to see just what your arrangement a...

10 years ago | 0

Answered
i made a script and it changed but i dont know how and why
You somehow managed to use the m-file name as the target of a *save* operation and overwrote the script with a .mat file. In ot...

10 years ago | 1

Answered
convert decimal to binary (for whole column)
doc dec2bin % for details...

10 years ago | 0

Answered
why I am having this "Cell contents assignment to a non-cell array object."error?
_data_ must be an existing array of *double* or other non-cell type already. clear data before beginning the script.

10 years ago | 0

| accepted

Answered
How to create a matrix P containing the coordinates (xi,yi) as columns
P=[x y]; % x,y column vectors of same length P=[x; y].'; % x,y row vectors of same length

10 years ago | 0

Answered
Using the exist function, on a user defined variable in a function.
Use *inputname* to find the name of the variable passed to the function and check its existence. But, of course, it has to have...

10 years ago | 0

Answered
How can you split a table (or array) based on similar values in a column?
# is most simply accomplished by first doing (you guessed it...) # sort by id Once you've done that, then simply find the po...

10 years ago | 0

Answered
reading text from various positions
Essentially other respondent's solution with a few shortcuts along the way of not building the intermediaries primarily...althou...

10 years ago | 0

Answered
Find match for a pair of rows in cell arrays
Adam's on the right track, just didn't quite recognize the problem description-- >> ab=[char(alfa) char(beta)]; % mush the...

10 years ago | 0

| accepted

Answered
Opening a .csv file from command line
*uiimport*

10 years ago | 1

| accepted

Answered
problem with dialog text box
If you mean a uicontrol textbox, they're static controls and users cannot change text interactively. You can only programmatica...

10 years ago | 0

Answered
Matching data and time with sample number
Find the elapsed time and convert to number of samples-- >> t0='11/19/2015 18:00';target='11/20/2015 6:34'; % given exampl...

10 years ago | 0

| accepted

Answered
I am trying to create a function form a vector from my matrix and I do not understand where my mistake is?
_"...transform my matrix into a vector"_ Really don't need a function for this; Matlab has syntax to do it already. A previo...

10 years ago | 0

Answered
How do I append data to an existing datafile? I don't want to overwrite any data, just simply add to it - is there a specific append or concat function i can use?
In what form does this file exist? In general, for text files you can use *fopen* w/ the append mode switch but you'll have to ...

10 years ago | 0

Answered
plotyy with bars side by side
Not sure exactly what you're trying to show, but try the following for starters-- x=x.'; y1=y1.'; y2=y2.'; % needs must...

10 years ago | 0

Answered
Why won't hold on work in this code?
Work out some trig identities but note that >> x=[-6*pi:12*pi/100:6*pi]; % define a commensurate range of x consistent w/ ...

10 years ago | 0

| accepted

Answered
deleting rows using setdiff?
For what you're looking for, *ismember* is better than *setdiff* -- x=[2;1;5;6;8]; y=[1;2;5;6]; % wanted values of ...

10 years ago | 0

Answered
Using the deviation of a linear regression calculation to trim the calculated data in the linear regression itself.
As John says, it may not work well for all data sets but for the above that is quite clean, >> xy=[... -58.402504309519...

10 years ago | 0

Answered
how to count identical elements in a non-symmetrical matrix?
>> x = [ 0 1 1 0 ; 1 0 0 1 ; 0 0 0 1 ; 1 1 0 0] >> [[1:4].' sum(x.*x.',2)] ans = 1 1 2 2 ...

10 years ago | 0

| accepted

Answered
h = mod(prod(uint8('Welcome42')),2^24-3); returns the wrong result ?
prod('Welcome42') overflows a double which is the default output type unless 'native' is given as optional argument. Plus, cert...

10 years ago | 0

Answered
how can i convert 8760 hourly data to ten minute data ?
Find the underlying database and resample it, perhaps? If you don't have finer granularity than hourly samples, there's nothi...

10 years ago | 0

| accepted

Answered
How do I get the sum for every i = 1: N-1?
To begin with, don't use multiple variables to hold a single variable; use an array instead. Then simply reference the desired ...

10 years ago | 0

Answered
Error using ==> eval
_*DON'T DO THIS!!!*_ See <http://www.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-variables.html <generate-f...

10 years ago | 0

Answered
fitting a negative exponential function to a profile
fnz=@(b,x) = b(1) + (b(2)-b(1))*exp(-b(3)*(x-b(4)); b=nlinfit(x,y,fnz,b0); where you've estimated an initial starting va...

10 years ago | 0

Answered
I plotted time series electricity load data in matlab and then used matlab "basic fitting" tools for best fitting. Now i require the values of the best fitted curve, is there a way to extract these values using a code or any other way??
Well, the ease of the tool comes at something of a price; it doesn't have the ability to automatically return everything you've ...

10 years ago | 1

| accepted

Answered
Help ! Excel import to Matlab
That's an Excel question (or at least approach to the question) rather than Matlab. You'd have to use a lookup function in Exce...

10 years ago | 0

Answered
How to subtract a surface equation from a surface 'scatter plot'?
Simple. dZ=zvalue-Test(xvalue,yvalue); Just evaluate the equation at the existing points and compute the difference. ...

10 years ago | 0

| accepted

Load more