Answered

Output of a function varies in size for each iteration

Probably as simple a solution as any is to return the indices where the change occurs with both row and column in a form that d...

Output of a function varies in size for each iteration

Probably as simple a solution as any is to return the indices where the change occurs with both row and column in a form that d...

8 jours ago | 0

| accepted

Answered

How to use readtable when skipping every second (non-data) line?

>> C=readcell('samplefile.txt'); >> C=C(9:2:end,:); >> C(1:12,:) ans = 12×3 cell array {[16]} {[26]} {'52.7 ...

How to use readtable when skipping every second (non-data) line?

>> C=readcell('samplefile.txt'); >> C=C(9:2:end,:); >> C(1:12,:) ans = 12×3 cell array {[16]} {[26]} {'52.7 ...

8 jours ago | 0

Answered

Add large amount of variables

Don't try to explain in words; show us precisely what the external software generates. " They are all inside a .mat file..." T...

Add large amount of variables

Don't try to explain in words; show us precisely what the external software generates. " They are all inside a .mat file..." T...

8 jours ago | 1

Answered

StackedPlots: Problem by moving Legend out of plot and expand distance between single charts

The stacked plot is pretty much "what you see is what you get" -- not much is user-variable about the layout -- in particular, f...

StackedPlots: Problem by moving Legend out of plot and expand distance between single charts

The stacked plot is pretty much "what you see is what you get" -- not much is user-variable about the layout -- in particular, f...

9 jours ago | 0

Answered

write from cell aray to txt file

fprintf example <<Tabular text file> illustrates a fixed-width text file...if that's the intent use the width parameter on the '...

write from cell aray to txt file

fprintf example <<Tabular text file> illustrates a fixed-width text file...if that's the intent use the width parameter on the '...

9 jours ago | 0

| accepted

Answered

Appending Values to an Empty Array

Because as written size() returns a two-vector and rate(end+1) is an address for a single array element -- you're trying to stor...

Appending Values to an Empty Array

Because as written size() returns a two-vector and rate(end+1) is an address for a single array element -- you're trying to stor...

10 jours ago | 0

Answered

How can I plot attached three interrelated stacked bars and separately style as well as label their partially recurring block components?

Use something like y = [5 2 0 4 0 0 5 0 3 0 3 0 5 2 0 0 3 ...

How can I plot attached three interrelated stacked bars and separately style as well as label their partially recurring block components?

Use something like y = [5 2 0 4 0 0 5 0 3 0 3 0 5 2 0 0 3 ...

10 jours ago | 1

Answered

column number extract using find function..

Use the optional second output form of find [r,c]=find(....);

column number extract using find function..

Use the optional second output form of find [r,c]=find(....);

11 jours ago | 0

Answered

How to change exponent position in an axis of a surface plot

It's an undocumented property -- hAx=gca; % get axes handle hY=hAx.YRuler; % and the subject axis ruler handle...

How to change exponent position in an axis of a surface plot

It's an undocumented property -- hAx=gca; % get axes handle hY=hAx.YRuler; % and the subject axis ruler handle...

12 jours ago | 1

| accepted

Answered

Interconnecting different sized matrices

Similar to above but to illustrate vector addressing would be c=[bob anne]; c=c(:,1:[3 end-1 4:6 end]);

Interconnecting different sized matrices

Similar to above but to illustrate vector addressing would be c=[bob anne]; c=c(:,1:[3 end-1 4:6 end]);

12 jours ago | 0

Answered

How to append values to an array in for loop?

>> for i=1:10:height(direction_table)-10 dx=abs(direction_table.direction(i+1:i+9)-direction_table.direction(i)); ix=find(dx>1...

How to append values to an array in for loop?

>> for i=1:10:height(direction_table)-10 dx=abs(direction_table.direction(i+1:i+9)-direction_table.direction(i)); ix=find(dx>1...

12 jours ago | 1

| accepted

Answered

Assign a categorical value to a table

N=[30,10,10,10]; % the number of the four categories each C=["Running";"Walking"...

Assign a categorical value to a table

N=[30,10,10,10]; % the number of the four categories each C=["Running";"Walking"...

13 jours ago | 0

| accepted

Answered

How to count the amount of times certain row changes in a table?

" Would taking these 3 columns apart help...?" No. tT.Diff=[false;any(diff(tT.X),2)];

How to count the amount of times certain row changes in a table?

" Would taking these 3 columns apart help...?" No. tT.Diff=[false;any(diff(tT.X),2)];

14 jours ago | 0

Answered

How to couple Matlab to other model for monte carlo simulations??

That all depends on how the other application reads/writes its input/output. If it uses files and you can specify the input/out...

How to couple Matlab to other model for monte carlo simulations??

That all depends on how the other application reads/writes its input/output. If it uses files and you can specify the input/out...

14 jours ago | 0

Answered

How to split only one column of a table (based on a space)?

If it's still in text form (string or cellstr), it's no problem dt=split(tTable.DateString); % split the component p...

How to split only one column of a table (based on a space)?

If it's still in text form (string or cellstr), it's no problem dt=split(tTable.DateString); % split the component p...

14 jours ago | 1

| accepted

Answered

How to make two different size matrix of same size

A1=[A1 A(:,end)]; could be one alternate solution...there is no unique answer without additional conditions placed on expected ...

How to make two different size matrix of same size

A1=[A1 A(:,end)]; could be one alternate solution...there is no unique answer without additional conditions placed on expected ...

15 jours ago | 1

Answered

Using indexed data to colour graph

See the documentation for the function rectangle() that you're using to do the drawing. The LH side of the page has links to th...

Using indexed data to colour graph

See the documentation for the function rectangle() that you're using to do the drawing. The LH side of the page has links to th...

15 jours ago | 0

| accepted

Answered

How can I plot these two variable in bars?

load sl % get variable titles T=categorical(T); % turn into categorical variable C=randi(200,1,n...

How can I plot these two variable in bars?

load sl % get variable titles T=categorical(T); % turn into categorical variable C=randi(200,1,n...

15 jours ago | 0

| accepted

Answered

How to find the occurrence of an element in a column of a table

tYourTable.Status=categorical(tYourTable.Status); % more convenient thatn cellstr() in use tCounts=groupsummary(tYourTable,'St...

How to find the occurrence of an element in a column of a table

tYourTable.Status=categorical(tYourTable.Status); % more convenient thatn cellstr() in use tCounts=groupsummary(tYourTable,'St...

15 jours ago | 0

| accepted

Answered

Save a table of results to an Excel file

Excel "knows nuthink!" about cell arrays; every cell can contain only one value. You'll have to expand to an array of sum of co...

Save a table of results to an Excel file

Excel "knows nuthink!" about cell arrays; every cell can contain only one value. You'll have to expand to an array of sum of co...

17 jours ago | 0

Answered

extract data from string

The dead-ahead approach... >> tok=split(s,','); >> str2double(tok([4:5 10:11])) ans = 0.45274 5.1296e-06 ...

extract data from string

The dead-ahead approach... >> tok=split(s,','); >> str2double(tok([4:5 10:11])) ans = 0.45274 5.1296e-06 ...

17 jours ago | 1

Answered

Index in position 1 is invalid. Array indices must be positive integers or logical values.

In new_roi = filtered(Schwerpunkte_X(i) - delta_x(j) : Schwerpunkte_X(i) + delta_x(j), ... Schwerpunkte_Y...

Index in position 1 is invalid. Array indices must be positive integers or logical values.

In new_roi = filtered(Schwerpunkte_X(i) - delta_x(j) : Schwerpunkte_X(i) + delta_x(j), ... Schwerpunkte_Y...

17 jours ago | 0

| accepted

Answered

Plot with two x axis and proper scaling/aligning

The idea is to set the limits of the second axes to the values corresponding to those of the first so the two plots are identica...

Plot with two x axis and proper scaling/aligning

The idea is to set the limits of the second axes to the values corresponding to those of the first so the two plots are identica...

18 jours ago | 0

Answered

How to remove the first element and last element based on First column

Of course there is. :) But, specifically how to do so is dependent on answer to several other questions regarding what is re...

How to remove the first element and last element based on First column

Of course there is. :) But, specifically how to do so is dependent on answer to several other questions regarding what is re...

18 jours ago | 0

Answered

How to crop the initial values and the last values of a column

The 'Range' named input parameter to readtable refers to the range of an input Excel spreadsheet and is not dynamic in its defin...

How to crop the initial values and the last values of a column

The 'Range' named input parameter to readtable refers to the range of an input Excel spreadsheet and is not dynamic in its defin...

18 jours ago | 1

| accepted

Answered

I have a txt file containing a Matrix separated by commas. I would like to add a comma after the last column on every row.

data=readlines('yourfile.txt'); % read file as string array data=data(strlength(data)>0); ...

I have a txt file containing a Matrix separated by commas. I would like to add a comma after the last column on every row.

data=readlines('yourfile.txt'); % read file as string array data=data(strlength(data)>0); ...

19 jours ago | 0

| accepted

Answered

I need a little help with reading from file.

That's an annoyingly difficult form to parse -- looks nice to read, but the mixture of text and data and different number variab...

I need a little help with reading from file.

That's an annoyingly difficult form to parse -- looks nice to read, but the mixture of text and data and different number variab...

19 jours ago | 0

| accepted

Answered

How to create new matrix in for loop?

MATLAB is "MATrix LABoratory" -- it operates on matrices and arrays by builtin syntax; that's a primary source of its power and ...

How to create new matrix in for loop?

MATLAB is "MATrix LABoratory" -- it operates on matrices and arrays by builtin syntax; that's a primary source of its power and ...

19 jours ago | 1

| accepted

Answered

Find time between 2 given time

OK, the above is one simple-minded approach that might work depending on the needs...another that works with the given data and ...

Find time between 2 given time

OK, the above is one simple-minded approach that might work depending on the needs...another that works with the given data and ...

19 jours ago | 1

| accepted

Answered

Reading a file without extension

Take @Stephen's comments to heart; they're important. D='/hamzah/adda/src/seq/results/test/run002_cylinder_g25_m1.105'; txt=re...

Reading a file without extension

Take @Stephen's comments to heart; they're important. D='/hamzah/adda/src/seq/results/test/run002_cylinder_g25_m1.105'; txt=re...

19 jours ago | 0

| accepted