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...

7 years 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...

7 years 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...

7 years ago | 1

| 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 ...

7 years 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 ...

7 years 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...

7 years 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...

7 years ago | 0

Answered
How to write function for above combine matrix?
n = 7; m = 3; A = repelem((1:ceil((3*n)/2))',2,m);

7 years 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...

7 years ago | 0

| accepted

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

7 years ago | 1

| 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...

7 years ago | 0

| accepted

Answered
How to Create Surface Plot From Cells?
Based on the discussion in the comments under the question, I think this is the approach you're looking for. It works (i.e. the...

7 years ago | 1

| accepted

Answered
change the color nodes
Your code is plotting each individual point within two for-loops. One option is to specify the color of the nodes within the fo...

7 years ago | 0

| accepted

Answered
Set the color of the axes per default to black (instead of dark gray)?
Try putting this in your startup.m file set(groot,{'DefaultAxesXColor','DefaultAxesYColor','DefaultAxesZColor'},{'k','k','k'}) ...

7 years ago | 3

| accepted

Answered
inner join two tables treating NaN entries as identical
Replace the NaNs with "inf", join the tables, then replace the inf with Nan. % Change NaNs to Infs A.Key2(isnan(A.Key2)) = in...

7 years ago | 0

| accepted

Answered
Including look up tables in a formula
I propose creating an anonymous function that stores the interpolated table and receives a velocity as input and outputs the ass...

7 years ago | 0

| accepted

Answered
convert string in app designer to dropbox output
This line is causing the problem app.nN = str2double(app.NoNodesEditField.Value); because app.NoNodesEditField.Value is alre...

7 years ago | 0

Answered
loop indexing length of non zeroes
Here are the steps needed to build your table. % Create fake data that looks like your example x = rand(2000,5); x(:,4) = 0;...

7 years ago | 0

Answered
Determining if two column adjacent values in a matrix cross over any values in a vector
After sorting the matrix so that minimum values of each row are on the left, you just need one line to find the intervals that '...

7 years ago | 1

| accepted

Answered
The order of plotted things vs the order of the legend
"Is there a way that I can change the order of the legend without affecting the plot order" Yes. Use object handles to specify...

7 years ago | 0

| accepted

Answered
How to display constant with caption in separate window
You can only plot text on axes (not on the figure background). However, the axes can be invisible so it appears as if the text ...

7 years ago | 0

| accepted

Answered
How to access/manipulate data from cell arrays?
This extracts column 2 data from all elements of the cell array and arranges it in a row within a cell array as you described. ...

7 years ago | 1

| accepted

Answered
How does the indexing of stacked bars work?
You can set individual colors by using an rgb matrix, one color for each bar within the current stack. The FaceColor should be ...

7 years ago | 0

| accepted

Answered
Remove non time string values in a time matrix
I would use datetime() to convert your cell array of strings to a datetime array. This will return NaT (not a time) for element...

7 years ago | 0

| accepted

Answered
sending mail from gmail using sendmail()
Check for interference with your antivirus program(s) and firewalls. These are common problems (see comments in that link).

7 years ago | 0

| accepted

Answered
Inconsistent Dates in Time Series
% Create fake data F = [cellstr(datestr(now-10:now, 'dd-mmm-yy')); cellstr(datestr(now-10:now, 'dd.mm.yyyy'))]; % Identify ...

7 years ago | 1

Answered
Why is it referring to each seperate datapoint in the legend?
Always use object handles. figure; ph1 = plot(acuteEdgeBC1, 'r*'); hold on; ph2 = plot(chronicEdgeBC1, 'bs'); legend([ph1(...

7 years ago | 3

| accepted

Answered
How to update plot data manually?
What about giving refreshdata() a shot? Here's how it would work with your description. % Create your 4 axes and their initia...

7 years ago | 0

Answered
Eliminate repetition in rows addition
You can replace those loops with this: A = [3 10; 5 6; 7 8]; triu(sum(A,2)+sum(A,2)',1) ans = 0 24 28 0 ...

7 years ago | 1

| accepted

Answered
How to clear graphical objects
Prior to drawing the updated ployshape, clear the axes using cla() and always specify the axis handle. cla(axHandle); ploysh...

7 years ago | 1

| accepted

Load more