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

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

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

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

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

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

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

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

How do I visually represent points on a graph?
scatter(x,y,60,change,'filled'); colormap('jet');

fast 2 Jahre ago | 0

| accepted

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

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

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

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

How to make a valid array for boxplots?
Provided an act of God, this might work: boxplot(cell2mat(c3));

fast 2 Jahre ago | 0

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

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

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

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

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

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

Create array with same number
twos = 2.* ones(length(x),1)

fast 2 Jahre ago | 4

greek symbols in disp command
disp('θ') works fine for me.

fast 2 Jahre ago | 0

| accepted

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

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

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

plotting multiple graphs in different colors with a single command

fast 2 Jahre ago | 0

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

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

Using the Save command to save a logical mask