Answered

How to build a matrix like this

n = 4; result = repmat((n:-1:1),n,1) - tril(cumsum(tril(ones(n)))-1)

How to build a matrix like this

n = 4; result = repmat((n:-1:1),n,1) - tril(cumsum(tril(ones(n)))-1)

fast 2 Jahre ago | 1

Answered

How to program a no periodic impulse train

intervals = [3,4,3]; hits = [1000,500,40]; result = cell(1,3); cnt = 0; beginning = 0; for ii = [cumsum(int...

How to program a no periodic impulse train

intervals = [3,4,3]; hits = [1000,500,40]; result = cell(1,3); cnt = 0; beginning = 0; for ii = [cumsum(int...

fast 2 Jahre ago | 0

| accepted

Answered

How to split a vector in to sub vectors?

v = rand(8812,1); n = 20; dummy = nan(20,ceil(numel(v)./n)); dummy(1:numel(v)) = v; result = nanmedian(dummy)

How to split a vector in to sub vectors?

v = rand(8812,1); n = 20; dummy = nan(20,ceil(numel(v)./n)); dummy(1:numel(v)) = v; result = nanmedian(dummy)

fast 2 Jahre ago | 0

Answered

Remove values from cell array based on condition

A= {[2,3,4,5,6]; [1,3,4,5,6,7,8] } B= {NaN, 1,1,-0.9,0.8,[],[]; NaN, NaN, 0.9,-1,NaN,0.8,0.2} result = cell(size(A)); ...

Remove values from cell array based on condition

A= {[2,3,4,5,6]; [1,3,4,5,6,7,8] } B= {NaN, 1,1,-0.9,0.8,[],[]; NaN, NaN, 0.9,-1,NaN,0.8,0.2} result = cell(size(A)); ...

fast 2 Jahre ago | 1

Answered

How to extract and convert mat from cell using for loop?

data = {rand(10,1),rand(20,11)}; for ii = 1:numel(data) result = data{ii}; %result is the extracted data end ...

How to extract and convert mat from cell using for loop?

data = {rand(10,1),rand(20,11)}; for ii = 1:numel(data) result = data{ii}; %result is the extracted data end ...

fast 2 Jahre ago | 0

Answered

Matrix call inside a for loop

data = {a1,a2,a4,a4}; %Better yet, use a cell array from start result = cell(size(data)); for ii = 1:numel(data) ...

Matrix call inside a for loop

data = {a1,a2,a4,a4}; %Better yet, use a cell array from start result = cell(size(data)); for ii = 1:numel(data) ...

fast 2 Jahre ago | 0

Answered

Make two matrices of same length reducing the size of largest matrix

result = {A,B} minDim = min(cellfun(@numel,result)); result = cellfun(@(x) {x(1:minDim)}, result);

Make two matrices of same length reducing the size of largest matrix

result = {A,B} minDim = min(cellfun(@numel,result)); result = cellfun(@(x) {x(1:minDim)}, result);

fast 2 Jahre ago | 0

Answered

compare between two unequal vectors

A = [2,3,4,5,6]; B = [2,3,4,6]; dummy = bsxfun(@eq, A',B) dummier = ismember(A,B)

compare between two unequal vectors

A = [2,3,4,5,6]; B = [2,3,4,6]; dummy = bsxfun(@eq, A',B) dummier = ismember(A,B)

fast 2 Jahre ago | 0

| accepted

Answered

How do I visually represent points on a graph?

scatter(x,y,60,change,'filled'); colormap('jet');

How do I visually represent points on a graph?

scatter(x,y,60,change,'filled'); colormap('jet');

fast 2 Jahre ago | 0

| accepted

Answered

Performing matrix subtraction for huge data

The problem is not _bsxfun_, it is the sheer amount of data: dataSize = 230600 * 1400000 * 8 (size of a double in bytes) m...

Performing matrix subtraction for huge data

The problem is not _bsxfun_, it is the sheer amount of data: dataSize = 230600 * 1400000 * 8 (size of a double in bytes) m...

fast 2 Jahre ago | 1

Answered

How to set bar beginning value?

aH = axes; minimum = rand(10,3); maximum = rand(10,3) + minimum; bH = bar(maximum); hold on; bH1 = bar(mini...

How to set bar beginning value?

aH = axes; minimum = rand(10,3); maximum = rand(10,3) + minimum; bH = bar(maximum); hold on; bH1 = bar(mini...

fast 2 Jahre ago | 1

| accepted

Answered

how can i place 25 image by using in one mask in successive manner?

This is how I interpret your question. imageSize = [256,256]; numImages = 25; result = zeros(numImages,imageSize(...

how can i place 25 image by using in one mask in successive manner?

This is how I interpret your question. imageSize = [256,256]; numImages = 25; result = zeros(numImages,imageSize(...

fast 2 Jahre ago | 0

| accepted

Answered

Reading large data set from text file & separating to individual column

Read in your data and then: dummy = '1950/05/21 04:00:00 1.7100 1 1'; result = regexprep(dummy,'[\s/:]+',' ') ...

Reading large data set from text file & separating to individual column

Read in your data and then: dummy = '1950/05/21 04:00:00 1.7100 1 1'; result = regexprep(dummy,'[\s/:]+',' ') ...

fast 2 Jahre ago | 0

| accepted

Answered

How to make a valid array for boxplots?

Provided an act of God, this might work: boxplot(cell2mat(c3));

How to make a valid array for boxplots?

Provided an act of God, this might work: boxplot(cell2mat(c3));

fast 2 Jahre ago | 0

Answered

Index exceeds matrix dimensions.

Type dbstop if error in the command line. Run your code. Look at the size of the variables in the operation that fail...

Index exceeds matrix dimensions.

Type dbstop if error in the command line. Run your code. Look at the size of the variables in the operation that fail...

fast 2 Jahre ago | 1

Answered

cumsum reset back to zero every 100 times

I interpreted _"reset cumsum to zero"_ as restart cumsum from scratch. data = rand(1,601); dummy = zeros(100,ceil(size(dat...

cumsum reset back to zero every 100 times

I interpreted _"reset cumsum to zero"_ as restart cumsum from scratch. data = rand(1,601); dummy = zeros(100,ceil(size(dat...

fast 2 Jahre ago | 1

| accepted

Answered

Averaging sequential data if values are the same?

key_column = [-6 -6 -6 -6 -5 -5 -3 -3 -3 -1 -1 -1 0 0 1 1 2 2 2 3 3 5 5 5 5 6 6 6 6 4 4 4 3 3 3 3 3 3 3 2 2 2 1 1 1 1 0 0 -1 ...

Averaging sequential data if values are the same?

key_column = [-6 -6 -6 -6 -5 -5 -3 -3 -3 -1 -1 -1 0 0 1 1 2 2 2 3 3 5 5 5 5 6 6 6 6 4 4 4 3 3 3 3 3 3 3 2 2 2 1 1 1 1 0 0 -1 ...

fast 2 Jahre ago | 0

Answered

Convert a table to an Excel file using Tofile

Are you sure that all the variables in your .mat file are valid for _xlswrite()_? From the documentation data.f{k}, should be...

Convert a table to an Excel file using Tofile

Are you sure that all the variables in your .mat file are valid for _xlswrite()_? From the documentation data.f{k}, should be...

fast 2 Jahre ago | 0

Answered

Set Colorbar TickLabels and TickMarks

plot(rand(10,1)) cH = colorbar; cH.TickLabelInterpreter = 'tex'; idx = 955; for ii = 1:numel(cH.TickLabels) ...

Set Colorbar TickLabels and TickMarks

plot(rand(10,1)) cH = colorbar; cH.TickLabelInterpreter = 'tex'; idx = 955; for ii = 1:numel(cH.TickLabels) ...

fast 2 Jahre ago | 0

Answered

please solve problem index increase matrix dimension.

Both _NumberOfNodes_ and _Etotal_DBR_ are scalars and it seems that you want to treat them as arrays and actually do some indexi...

please solve problem index increase matrix dimension.

Both _NumberOfNodes_ and _Etotal_DBR_ are scalars and it seems that you want to treat them as arrays and actually do some indexi...

fast 2 Jahre ago | 0

Answered

Formatting quiver() arrows

If you wanna go kosher: data = rand(10,4); qH = quiver(data(:,1),data(:,2),data(:,3),data(:,4),0); hold on qH1 = qui...

Formatting quiver() arrows

If you wanna go kosher: data = rand(10,4); qH = quiver(data(:,1),data(:,2),data(:,3),data(:,4),0); hold on qH1 = qui...

fast 2 Jahre ago | 0

Answered

Convert plotted graph to (x,y) coordinates?

It ain't pretty but it works. As far as I understand there are no simple options you can set to get the look you want. data ...

Convert plotted graph to (x,y) coordinates?

It ain't pretty but it works. As far as I understand there are no simple options you can set to get the look you want. data ...

fast 2 Jahre ago | 0

Answered

putting an exception in the plot command

You could use _setdiff()_ to do the indexing: data = rand(10,20); plot(data(:,setdiff(1:20,5:7))); Please accept the a...

putting an exception in the plot command

You could use _setdiff()_ to do the indexing: data = rand(10,20); plot(data(:,setdiff(1:20,5:7))); Please accept the a...

fast 2 Jahre ago | 1

| accepted

Answered

plotting multiple graphs in different colors with a single command

plot(distance_from_herder(1:length,1:11)); Please read the documentation.

plotting multiple graphs in different colors with a single command

plot(distance_from_herder(1:length,1:11)); Please read the documentation.

fast 2 Jahre ago | 0

Answered

How can I access the Axle property in an axis ruler?

If you want to make the x-axis disappear: ax.XAxis.Color = 'None';

How can I access the Axle property in an axis ruler?

If you want to make the x-axis disappear: ax.XAxis.Color = 'None';

fast 2 Jahre ago | 1

| accepted

Answered

How to used 'griddedinterpolant' command in for loop?

data = rand(10,10,100) for ii=1:100 subset = data(:,:,ii); %Copy probably unnecessary, left for clarity do_your_t...

How to used 'griddedinterpolant' command in for loop?

data = rand(10,10,100) for ii=1:100 subset = data(:,:,ii); %Copy probably unnecessary, left for clarity do_your_t...

fast 2 Jahre ago | 1

| accepted

Answered

Using the Save command to save a logical mask

data = handles.mask; save('someFile.mat','data');

Using the Save command to save a logical mask

data = handles.mask; save('someFile.mat','data');

fast 2 Jahre ago | 1

Answered

Unit of the MarkerSize in a 3D plot?

Doesn't matter if your plot is 3D, it is still rendered on a 2D plane. <http://printwiki.org/Point_Size>

Unit of the MarkerSize in a 3D plot?

Doesn't matter if your plot is 3D, it is still rendered on a 2D plane. <http://printwiki.org/Point_Size>

fast 2 Jahre ago | 0

| accepted