Answered
I use MATLAB 2015. I have data plot x and y. How i can do moving average?. I want to compare original waveform with mean of the waveform.
The easiest way to calculate a moving average is to use <http://www.mathworks.com/help/matlab/ref/conv.html |conv|>: >> X =...

10 years ago | 0

| accepted

Answered
How to access double arrays in a cell array?
Here are two solutions to your two tasks. First create some fake data: >> fun = @()randi(9,20,1); >> C = {fun(),fun(),fu...

10 years ago | 1

| accepted

Answered
inner product (the result is out of my control)
You are getting confused because you are putting a function (returned by |innerprod|) inside another function (which you call |m...

10 years ago | 0

| accepted

Answered
Extract strings between one repeated tag in a XML file
Getting <http://www.mathworks.com/help/matlab/matlab_prog/regular-expressions.html regular expressions> to do what you want them...

10 years ago | 0

| accepted

Answered
Passing structure field name in function
structure(i).substructure.(field_identifier) This is clearly explained in the documentation: <http://www.mathworks.com/help/...

10 years ago | 0

| accepted

Answered
How to use fprintf in Matlab R2016a
The problem really has nothing to do with |fprintf|, it is actually because <http://www.mathworks.com/help/matlab/ref/fopen.html...

10 years ago | 1

| accepted

Answered
Averaging multi-dimensional arrays across several dimensions at once
Don't waste time with ugly loops when you can write neat and efficient MATLAB code: >> A = randi(9,6,5,4,3,2); % fake data ...

10 years ago | 4

Answered
How do I fill a rectangle (or circle) in a matrix?
No toolboxes and no loops are required: >> M = [... 1 1 1 1 1 1 1 1 1 1 ...

10 years ago | 1

Answered
What is an indexed image?
There are very good and thorough explanations online: <http://www.mathworks.com/help/matlab/creating_plots/image-types.html> ...

10 years ago | 1

| accepted

Answered
How to join every row of an array of strings in a single string for time plotting purposes.
Whoever gave you that function made a mistake, you should be using <http://www.mathworks.com/help/matlab/ref/strcat.html |strcat...

10 years ago | 0

| accepted

Answered
getting the day of the week for a given date
>> datestr(datenum('June 8, 2016','mmmm dd, yy'),'dddd') ans = Wednesday >> datestr(datenum('November 29, 2016','mmmm...

10 years ago | 1

Answered
Could someone please explain to me how to take characters from a text file and put it in MATLAB?
This code will read in the whole file (well, it works on your sample file): fid = fopen('MLsensLiftStartexample.txt','rt');...

10 years ago | 0

| accepted

Answered
" Unable to determine the file formt from the file name" ERROR. Please help!
This is very clear form the error message: <http://www.mathworks.com/help/matlab/ref/imwrite.html |imwrite|> is not being given ...

10 years ago | 2

Answered
Union of cell matrix
>> A={[1 2 3] [2 8] [9 2 5]}; >> unique([A{:}]) ans = 1 2 3 5 8 9

10 years ago | 1

Answered
How to get creation date of files
Try this FEX submission: <http://www.mathworks.com/matlabcentral/fileexchange/24671-filetime> Or on windows you can call t...

10 years ago | 0

| accepted

Answered
How to set out put files to save at user selected path?
Here is the MATLAB documentation page which explains all of the recommended ways to pass data between callbacks, including lots ...

10 years ago | 0

Answered
How to average multiple arrays of doubles from a row of a cell array as long as a criterium holds in that row
foo = @()randi(9,1,5); % for testing, 1x5 vectors. A = { 84,1,1,1,8,1,1,foo(),foo(),foo(); 84,1,2,1,8,1,1,foo(),foo()...

10 years ago | 1

| accepted

Answered
How to create a formated text output (for example rich text) from MATLAB?
http://www.mathworks.com/matlabcentral/answers/22744-how-to-bold-italics-sentence-using-fprintf-in-matlab

10 years ago | 0

Answered
How find non zero
>> A = [ 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0]; >> fun = @(n)find(A,1)-(n:-1:1); >> fun(2) ans = 6 7 >> fun...

10 years ago | 0

| accepted

Answered
How to create a checkerboard image without using the inbuilt function?
Here is one way without using any toolbox functions, or any slow (and ugly) loops: >> imgSiz = [16,12]; >> blkSiz = [4,4...

10 years ago | 0

| accepted

Answered
inputdlg box to pass variables
nExp = sscanf(answer{1},'%d,'); exps = sscanf(answer{2},'%d,');

10 years ago | 0

| accepted

Answered
matlab error Not enough input arguments.
Your function calls itself, and then inside that it calls itself again, and so on. A function calling itself is called recursion...

10 years ago | 0

Answered
What should I put in Filen to place to Function?
The input |filen| should be the filename _without any file extension_. All of the four files must have _the same name_ (only ...

10 years ago | 0

Answered
why can't use functions, although I know the inputs and outputs are there?
When |y| is zero then you do not define |sentido| (and also potentially if |y| is not scalar, but you do not tell us anything ab...

10 years ago | 0

Answered
Spliting a cell based on the values of a column
There is no need to use any loop: >> C = {1,'PB1';3,'PB2';1,'PBC';2,'PB1';1,'PBC'} >> [V,idx] = sort([C{:,1}]) >> D =...

10 years ago | 0

Answered
Recommendation: Struct or Cell array for panel data?
Rather than starting from a _top-down_ decision, a good rule of thumb is to make this a _bottom-up_ decision: *Use the simple...

10 years ago | 0

| accepted

Answered
Using a loop to solve the following matrix. Using a loop to solve the following matrix. I have almost resolved, they could help me?
*Random -1 and +1 (like your example):* >> N = 6; >> X = [-1,1]; >> X(randi(2,N)).*~eye(N) ans = 0 1 1 ...

10 years ago | 1

| accepted

Answered
how to use regexp for negative and positive integers?
This regular expression allows an optional +/- sign and decimal digits: >> regexp(FSR1, '(+|-)?\d+(\.\d+)?', 'match', 'once...

10 years ago | 1

Answered
Saving +- 2000 tiff images.
Each image has size 2085x1811x3 and is stored with 3*eight bits per pixel, then each image requires 11 megabytes of memory. Ther...

10 years ago | 0

| accepted

Answered
Newbie question about table indexing,loops and logical arguments (should be easy)
There is no need to waste time with an ugly loop: >> X = {'A','','','B','B','','C','C',''}; >> idx = ~cellfun('isempty',...

10 years ago | 0

Load more