Answered

How to change the color of plotting lines

The line of code that apparently does the plotting is cut off in your image. Either specify the color during plotting plot(x,...

How to change the color of plotting lines

The line of code that apparently does the plotting is cut off in your image. Either specify the color during plotting plot(x,...

7 Tage ago | 0

| accepted

Answered

Splitting data in Matlab

Since there might not be an equal number of wind speeds above and below your threshold, you shouldn't use a matrix (which requir...

Splitting data in Matlab

Since there might not be an equal number of wind speeds above and below your threshold, you shouldn't use a matrix (which requir...

7 Tage ago | 0

| accepted

Answered

Formatted string plus list of numbers using sprintf

numberList = round(rand(1,10)*10); s = ['Record',regexprep(num2str([1,numberList]),' +',',')];

Formatted string plus list of numbers using sprintf

numberList = round(rand(1,10)*10); s = ['Record',regexprep(num2str([1,numberList]),' +',',')];

7 Tage ago | 0

| accepted

Answered

function structure and explanation

Here's all the information available (link below). Start by reading the "description" section. Also see the "Algorithms" sectoi...

function structure and explanation

Here's all the information available (link below). Start by reading the "description" section. Also see the "Algorithms" sectoi...

7 Tage ago | 0

| accepted

Answered

I need to divide two matrix with different rows and column

Your description asks for two different things. "I want to divide D=A(of 1st element) / B(of complete Row)" % Fake data A = ...

I need to divide two matrix with different rows and column

Your description asks for two different things. "I want to divide D=A(of 1st element) / B(of complete Row)" % Fake data A = ...

7 Tage ago | 0

| accepted

Answered

Time stamp formatting question

dtstr = '0d 00:00:5.03000020980835'; dtstr = regexprep(dtstr,'\d+d',''); %remove days dt = datetime(dtstr,'InputForma...

Time stamp formatting question

dtstr = '0d 00:00:5.03000020980835'; dtstr = regexprep(dtstr,'\d+d',''); %remove days dt = datetime(dtstr,'InputForma...

8 Tage ago | 1

| accepted

Answered

how can I do it without using eval

Assuming the handles are stored in a vector, allhand = [h1,h2,h3]; %row vector tags = get(allhand, 'tag'); hand...

how can I do it without using eval

Assuming the handles are stored in a vector, allhand = [h1,h2,h3]; %row vector tags = get(allhand, 'tag'); hand...

8 Tage ago | 0

| accepted

Answered

how to change nomber of rows in the ui table?

Add empty rows to the "data" property. Here's a demo. data = get(handles.Table, 'Data'); % get the current data in your UI...

how to change nomber of rows in the ui table?

Add empty rows to the "data" property. Here's a demo. data = get(handles.Table, 'Data'); % get the current data in your UI...

8 Tage ago | 0

Answered

Random Generator with known characters

Use randperm() or randi() One of those resamples without replacement while the other resamples with replacement (I'll let you re...

Random Generator with known characters

Use randperm() or randi() One of those resamples without replacement while the other resamples with replacement (I'll let you re...

8 Tage ago | 0

Answered

HOW TO IDENTIFY MEAN AND STANDARD DEVIATION FOR THIS CODE?

It looks like you want to calculate the mean squared error between the I and BW arrays which can be done using immse() from the ...

HOW TO IDENTIFY MEAN AND STANDARD DEVIATION FOR THIS CODE?

It looks like you want to calculate the mean squared error between the I and BW arrays which can be done using immse() from the ...

8 Tage ago | 0

| accepted

Answered

Save plot with minimal white space without removing part of the figure

Follow this demo to maximize an axis with equal aspect ratio and a colorbar within a figure. % Set up figure size before movi...

Save plot with minimal white space without removing part of the figure

Follow this demo to maximize an axis with equal aspect ratio and a colorbar within a figure. % Set up figure size before movi...

8 Tage ago | 1

| accepted

Answered

How can I remove the bars without values in hist3?

Use histogram2() instead (req. 2015b or later). % Instead of hist3([x,y]); %use histogram2(x,y) By default bars with 0 he...

How can I remove the bars without values in hist3?

Use histogram2() instead (req. 2015b or later). % Instead of hist3([x,y]); %use histogram2(x,y) By default bars with 0 he...

12 Tage ago | 0

| accepted

Answered

i have a function that should work but doesn't

Matlab doesn't know what "columns" means (nor "rows"). My guess is that 'columns' and 'rows' are the number of columns and rows...

i have a function that should work but doesn't

Matlab doesn't know what "columns" means (nor "rows"). My guess is that 'columns' and 'rows' are the number of columns and rows...

12 Tage ago | 1

| accepted

Answered

How can i convert daily rainfall data in monthly data?

I suggest reorganizing your data into a timetable with 41273 rows and 4 columns: Time, Lat, Long, RainFall. Then you can use ...

How can i convert daily rainfall data in monthly data?

I suggest reorganizing your data into a timetable with 41273 rows and 4 columns: Time, Lat, Long, RainFall. Then you can use ...

13 Tage ago | 1

| accepted

Answered

How can I add a table (independent of fig data) under figure?

In addition to Jan's UI table suggestion, you could convert the table to a character array and use text() to plot the array on a...

How can I add a table (independent of fig data) under figure?

In addition to Jan's UI table suggestion, you could convert the table to a character array and use text() to plot the array on a...

13 Tage ago | 0

| accepted

Answered

Multiple histogram with different colors for each bar

Use the output handles to the bar objects. h = bar(1:nx,matY'); h(1).FaceColor = [0 0 0]; %first bar group h(2).FaceColor ...

Multiple histogram with different colors for each bar

Use the output handles to the bar objects. h = bar(1:nx,matY'); h(1).FaceColor = [0 0 0]; %first bar group h(2).FaceColor ...

13 Tage ago | 1

| accepted

Answered

Sorting data in large data set

The data in the image you shared appear to be in a spreadsheet and surrounded by single quotes. I'll assume you've imported tho...

Sorting data in large data set

The data in the image you shared appear to be in a spreadsheet and surrounded by single quotes. I'll assume you've imported tho...

13 Tage ago | 1

| accepted

Answered

Extract and save data between two regions

Here's a rough idea that you can tweek so that it performs better. It involves calculating the slope of each line segment. The...

Extract and save data between two regions

Here's a rough idea that you can tweek so that it performs better. It involves calculating the slope of each line segment. The...

14 Tage ago | 1

| accepted

Answered

Removing repeating data points but keeping the first and last ones

A is your input matrix, Ap is the trimmed matrix. isUnq = find(~any(diff(A([1,2],:),[],2)==0, 1))+1; keepColIdx = unique([1,i...

Removing repeating data points but keeping the first and last ones

A is your input matrix, Ap is the trimmed matrix. isUnq = find(~any(diff(A([1,2],:),[],2)==0, 1))+1; keepColIdx = unique([1,i...

14 Tage ago | 0

Answered

How to extract rows which contains specific values in each row, then automatically repeat the process for a range.

The reason you're getting the same values is because "X" always equals the same thing: X = t1{:,{'x0102ThrottleNotch'}}; n=0...

How to extract rows which contains specific values in each row, then automatically repeat the process for a range.

The reason you're getting the same values is because "X" always equals the same thing: X = t1{:,{'x0102ThrottleNotch'}}; n=0...

14 Tage ago | 0

| accepted

Answered

Save char array from for loop into a matrix

No need to use a loop. If filenames is a cell array of strings and indx is a logical vectory (or linear index vector), you just...

Save char array from for loop into a matrix

No need to use a loop. If filenames is a cell array of strings and indx is a logical vectory (or linear index vector), you just...

15 Tage ago | 0

Answered

Extract data between peaks

This segregates the EMG1 data by every 2 right-foot steps. rightFootIdx = 1 : 2 : numel(locs); for i = 1:length(rightFootId...

Extract data between peaks

This segregates the EMG1 data by every 2 right-foot steps. rightFootIdx = 1 : 2 : numel(locs); for i = 1:length(rightFootId...

15 Tage ago | 1

| accepted

Answered

Error using 'omitnan'

Check out nanmean() in the stats & machine learning toolbox. An alternative that doesn't require any toolboxes: nanidx = isn...

Error using 'omitnan'

Check out nanmean() in the stats & machine learning toolbox. An alternative that doesn't require any toolboxes: nanidx = isn...

15 Tage ago | 0

| accepted

Answered

How make this code execute faster?

Sidx = ismember(1:size(X,1),S); M = X(Sidx,~Sidx); cost = sum(min(M,[],1)); This versions is slightly faster. I ran your ...

How make this code execute faster?

Sidx = ismember(1:size(X,1),S); M = X(Sidx,~Sidx); cost = sum(min(M,[],1)); This versions is slightly faster. I ran your ...

16 Tage ago | 0

| accepted

Answered

Change path of where the excel files are store and run the code

This will store the full path to all selected files as strings in a cell array. You can then loop through the cell array to act ...

Change path of where the excel files are store and run the code

This will store the full path to all selected files as strings in a cell array. You can then loop through the cell array to act ...

18 Tage ago | 0

Answered

from squared signal to sine form

If the parameters of your square wave are known (amp, phase, frequency, shift), you can probably generate the sine wave directly...

from squared signal to sine form

If the parameters of your square wave are known (amp, phase, frequency, shift), you can probably generate the sine wave directly...

19 Tage ago | 0

| accepted

Answered

Split function for text ( split(...) or strsplit(...))

Try this out. I don't have your data so I'm taking a shot in the dark. It may require a small tweak. str = extractFileText(f...

Split function for text ( split(...) or strsplit(...))

Try this out. I don't have your data so I'm taking a shot in the dark. It may require a small tweak. str = extractFileText(f...

19 Tage ago | 0

Answered

How to write function for above combine matrix?

n = 7; m = 3; A = repelem((1:ceil((3*n)/2))',2,m);

How to write function for above combine matrix?

n = 7; m = 3; A = repelem((1:ceil((3*n)/2))',2,m);

19 Tage ago | 0

Answered

How to insert zeros in a data returns

For r2016b or later Assuming your dates are a cell array of strings in the format you described in the comments under your ques...

How to insert zeros in a data returns

For r2016b or later Assuming your dates are a cell array of strings in the format you described in the comments under your ques...

20 Tage ago | 0

| accepted

Answered

How can I write matrix for all variables/ arrays etc in workspace?

This sounds like a quagmire. Why not just save the data in a mat file? If you want to proceed with that idea, I recommend man...

How can I write matrix for all variables/ arrays etc in workspace?

This sounds like a quagmire. Why not just save the data in a mat file? If you want to proceed with that idea, I recommend man...

20 Tage ago | 0

| accepted