Answered

Failed to read xml error when using xmlread

... try DOMnode=xmlread(filename(i)); % try to read the file catch ME % catch the failure; f...

Failed to read xml error when using xmlread

... try DOMnode=xmlread(filename(i)); % try to read the file catch ME % catch the failure; f...

2 dagen ago | 0

Answered

How can i adjust the figure window size to display legend ?

hLg=legend({'\phi = 90^{o}','\phi = 90^{o}'},'Location','SouthOutside','Orientation','Horizontal');

How can i adjust the figure window size to display legend ?

hLg=legend({'\phi = 90^{o}','\phi = 90^{o}'},'Location','SouthOutside','Orientation','Horizontal');

2 dagen ago | 0

| accepted

Answered

Returning specific string from a given string that are found between two given substrings ?

input1=[0 0 0 0 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 ]; substring1=[0 ...

Returning specific string from a given string that are found between two given substrings ?

input1=[0 0 0 0 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 ]; substring1=[0 ...

3 dagen ago | 0

| accepted

Answered

Error: Unable to perform assignment because the left and right sides have a different number of elements.

h(r+1)= (y(x+1)^2)*cos((2*k*pi*t)/l); Error here Above, t was defined as t = -a/2:a/(2-1); and a = K*M ==> 4. 6...

Error: Unable to perform assignment because the left and right sides have a different number of elements.

h(r+1)= (y(x+1)^2)*cos((2*k*pi*t)/l); Error here Above, t was defined as t = -a/2:a/(2-1); and a = K*M ==> 4. 6...

5 dagen ago | 0

Answered

Read hex strings from text file into struct

It's pretty quick to read and separate out the data by fid=fopen('data.txt'); s=textscan(fid,'%s','delimiter','\n','whitespace...

Read hex strings from text file into struct

It's pretty quick to read and separate out the data by fid=fopen('data.txt'); s=textscan(fid,'%s','delimiter','\n','whitespace...

7 dagen ago | 1

| accepted

Answered

How to separate specific data from an array in a new file?

ia=ismember(data(:,1),[1:3]); writematrix(data(ix,:))

How to separate specific data from an array in a new file?

ia=ismember(data(:,1),[1:3]); writematrix(data(ix,:))

8 dagen ago | 0

Answered

Plotting a graph through the points

plot(x,y,'*-','LineWidth',2); b1=polyfit(x,y,1); y1=polyval(b1,[x(1),x(end)]); hold on plot([x(1),x(end)],y1,'r:'); b2=poly...

Plotting a graph through the points

plot(x,y,'*-','LineWidth',2); b1=polyfit(x,y,1); y1=polyval(b1,[x(1),x(end)]); hold on plot([x(1),x(end)],y1,'r:'); b2=poly...

9 dagen ago | 0

| accepted

Answered

finding peaks at specific indices/values

The actual bin frequency is unlikely to match the harmonics frequencies exactly (as in they won't match) so simply selecting the...

finding peaks at specific indices/values

The actual bin frequency is unlikely to match the harmonics frequencies exactly (as in they won't match) so simply selecting the...

9 dagen ago | 0

| accepted

Answered

What data type is valid for piecewise functions?

syms x y = piecewise(x<0, -x, x>0, x); fplot(y,'r') axis([-10 10 -10 10])

What data type is valid for piecewise functions?

syms x y = piecewise(x<0, -x, x>0, x); fplot(y,'r') axis([-10 10 -10 10])

9 dagen ago | 0

Answered

how to replace multiple values per second with their standard deviaton?

Read the doc more carefully... TT2=retime(TT,'secondly',@std)

how to replace multiple values per second with their standard deviaton?

Read the doc more carefully... TT2=retime(TT,'secondly',@std)

11 dagen ago | 0

| accepted

Answered

I need to plot a Dynamic scattered plot. I have vector x and y, and those are coordinates. I need to plot coordinate 1, and then coordinate 2 but coordinate 1 must need to still there.

h = animatedline('Marker','none'); There's your problem... array=readmatrix('laser_data.csv'); % no point in a tab...

I need to plot a Dynamic scattered plot. I have vector x and y, and those are coordinates. I need to plot coordinate 1, and then coordinate 2 but coordinate 1 must need to still there.

h = animatedline('Marker','none'); There's your problem... array=readmatrix('laser_data.csv'); % no point in a tab...

12 dagen ago | 0

| accepted

Answered

How to search for header name and only pull that column as an array you can multiply

If you loaded the .csv into a table with headers that are variable names, you don't need to search nor "pull" data -- just refer...

How to search for header name and only pull that column as an array you can multiply

If you loaded the .csv into a table with headers that are variable names, you don't need to search nor "pull" data -- just refer...

12 dagen ago | 0

| accepted

Answered

Plotting a figure with bars in stack

Any number of ways; a braind-dead sample y=sort(rand(20,2),1,'ascend'); % some dummy y data figure,hold on ...

Plotting a figure with bars in stack

Any number of ways; a braind-dead sample y=sort(rand(20,2),1,'ascend'); % some dummy y data figure,hold on ...

13 dagen ago | 0

| accepted

Answered

Particularly strange bug using the eval function

From the doc-- Whenever possible, do not include output arguments within the input to the eval function, such as eval(['outpu...

Particularly strange bug using the eval function

From the doc-- Whenever possible, do not include output arguments within the input to the eval function, such as eval(['outpu...

14 dagen ago | 2

Answered

How do I erase string duplicates in one column of a cell array and add the strings' corresponding numbers in the second column?

>> c c = 6×2 cell array {'Sarah' } {[12]} {'Marie' } {[ 3]} {'Sam' } {[ 5]} {'Rose' } {[ ...

How do I erase string duplicates in one column of a cell array and add the strings' corresponding numbers in the second column?

>> c c = 6×2 cell array {'Sarah' } {[12]} {'Marie' } {[ 3]} {'Sam' } {[ 5]} {'Rose' } {[ ...

14 dagen ago | 1

Answered

Why do my FFTs look wildly different?

Above just based on the figures; reading the m file reveals a major problem -- you only processed the first N = 1024 points of ...

Why do my FFTs look wildly different?

Above just based on the figures; reading the m file reveals a major problem -- you only processed the first N = 1024 points of ...

15 dagen ago | 0

Answered

Error: File: t2_m1.m Line: 46 Column: 8 The input character is not valid in MATLAB statements or expressions.

Unrecognized function or variable 'material_1'. >> material_1=rand(10,120); >> x = (2:2:120); c_1 = material_1(:, x); vf_1 ...

Error: File: t2_m1.m Line: 46 Column: 8 The input character is not valid in MATLAB statements or expressions.

Unrecognized function or variable 'material_1'. >> material_1=rand(10,120); >> x = (2:2:120); c_1 = material_1(:, x); vf_1 ...

15 dagen ago | 0

| accepted

Answered

Plotting several .txt files

... fullFileName = fullfile(theFiles(k).folder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); plot(fullFileNam...

Plotting several .txt files

... fullFileName = fullfile(theFiles(k).folder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); plot(fullFileNam...

15 dagen ago | 0

| accepted

Answered

Matrix addition in a loop in a random column

Must reference the same size section of array on LHS of an assignment as the RHS unless assign the entire LHS variable to RHS. ...

Matrix addition in a loop in a random column

Must reference the same size section of array on LHS of an assignment as the RHS unless assign the entire LHS variable to RHS. ...

16 dagen ago | 0

Answered

Carry trade portfolio with 20 countries

That was kinda' fun!!! :) % create some sample data...use a table for convenience tPort=[ table(datetime(1997,0:20,1,'For...

Carry trade portfolio with 20 countries

That was kinda' fun!!! :) % create some sample data...use a table for convenience tPort=[ table(datetime(1997,0:20,1,'For...

16 dagen ago | 0

Answered

Creating a built in function?

Don't put it on the Desktop, create a folder in your user area for MATLAB and then add that folder to the MATLABPATH and make pe...

Creating a built in function?

Don't put it on the Desktop, create a folder in your user area for MATLAB and then add that folder to the MATLABPATH and make pe...

18 dagen ago | 1

| accepted

Answered

How do you get multiple minimum values in a column based on grouping and then isolate the corresponding rows for the whole table?

[g,ig]=findgroups(data.names); b=splitapply(@(x) {maxk(x,10)},data.age,g); b contains the k oldest elements for each group...y...

How do you get multiple minimum values in a column based on grouping and then isolate the corresponding rows for the whole table?

[g,ig]=findgroups(data.names); b=splitapply(@(x) {maxk(x,10)},data.age,g); b contains the k oldest elements for each group...y...

18 dagen ago | 0

| accepted

Answered

peak in fixed interval in findpeaks

There simply isn't much in the way of a peak to find -- I can't discern enough even by eye to count to eleven in that trace... ...

peak in fixed interval in findpeaks

There simply isn't much in the way of a peak to find -- I can't discern enough even by eye to count to eleven in that trace... ...

18 dagen ago | 0

| accepted

Answered

Reduce the distance between boxplots

Carrying on from the above idea... data=rand(10,16); % just some random data w/ 16 variables/columns data2=[]; for i=...

Reduce the distance between boxplots

Carrying on from the above idea... data=rand(10,16); % just some random data w/ 16 variables/columns data2=[]; for i=...

19 dagen ago | 1

| accepted

Answered

How to label Y axes in place of column1 column 2 etc

YT=cellstr(datetime(2020,1:12,1,'Format','MMMyy')); % cellstr array of MMMyy hSP=stackedplot(YT.','DisplayLabels',YT); ...

How to label Y axes in place of column1 column 2 etc

YT=cellstr(datetime(2020,1:12,1,'Format','MMMyy')); % cellstr array of MMMyy hSP=stackedplot(YT.','DisplayLabels',YT); ...

19 dagen ago | 0

Answered

Is it possible to write the function (mathematical formula) of a custom probability distribution from data?

To generate a functional form totally independently from only a dataset is pretty much not feasible. There are a number of gene...

Is it possible to write the function (mathematical formula) of a custom probability distribution from data?

To generate a functional form totally independently from only a dataset is pretty much not feasible. There are a number of gene...

19 dagen ago | 0

Answered

Draw a colored error map based on the measurement error

More than one way to skin a cat... :) hHM=heatmap(reshape(RMSE,6,6)); % draw the heatmap; fixup some to draw on top...

Draw a colored error map based on the measurement error

More than one way to skin a cat... :) hHM=heatmap(reshape(RMSE,6,6)); % draw the heatmap; fixup some to draw on top...

19 dagen ago | 1

| accepted

Answered

How to sort a table (only 2 rows)

[~,imin]=min(T.value); [~,imax]=max(T.value); T=[T(imin,:); T; T(imax,:)]; T([imin,imax],:)=[]; Or, save the two rows of int...

How to sort a table (only 2 rows)

[~,imin]=min(T.value); [~,imax]=max(T.value); T=[T(imin,:); T; T(imax,:)]; T([imin,imax],:)=[]; Or, save the two rows of int...

19 dagen ago | 0

Answered

How to load multiple files sequentially with no standard extension into MATLAB at once

If you place them all in a clean directory, then d=dir(fullfile('TheBearingDataSetDirectory','*.*')); will return all in a dir...

How to load multiple files sequentially with no standard extension into MATLAB at once

If you place them all in a clean directory, then d=dir(fullfile('TheBearingDataSetDirectory','*.*')); will return all in a dir...

20 dagen ago | 0

Answered

How can i set legend for different bar with different colors?

As per usual (despite some much-needed belated improvements on at least being able to label a bar, thanks! TMW) bar is still a r...

How can i set legend for different bar with different colors?

As per usual (despite some much-needed belated improvements on at least being able to label a bar, thanks! TMW) bar is still a r...

21 dagen ago | 0