Answered

How to prevent matlab from exponential form in displaying arrays

With the common disp() or echo of a variable to the command window, no--a MATLAB array is an entity. You can output in whatever...

How to prevent matlab from exponential form in displaying arrays

With the common disp() or echo of a variable to the command window, no--a MATLAB array is an entity. You can output in whatever...

ungefär 18 timmar ago | 0

Answered

Error using readtable: Must be a scalar logical value

"file names are Master w EQ 00 deg.txt, Master w EQ 05 deg.txt, etc up to Master w EQ 90 deg.txt." d=dir('Master*deg.txt'); fo...

Error using readtable: Must be a scalar logical value

"file names are Master w EQ 00 deg.txt, Master w EQ 05 deg.txt, etc up to Master w EQ 90 deg.txt." d=dir('Master*deg.txt'); fo...

ungefär 18 timmar ago | 0

| accepted

Answered

Need to calculate the mean without considering the 0 counts. In [1 2 3 4 0 6 7], mean should be (1+2+3+4+6+7)/6 and then output place the mean of six number at place of 0.

>> v=[1 2 3 4 0 6 7]; >> v(v==0)=mean(v(v~=0)) v = 1.0000 2.0000 3.0000 4.0000 3.8333 6.0000 7.0000 >>...

Need to calculate the mean without considering the 0 counts. In [1 2 3 4 0 6 7], mean should be (1+2+3+4+6+7)/6 and then output place the mean of six number at place of 0.

>> v=[1 2 3 4 0 6 7]; >> v(v==0)=mean(v(v~=0)) v = 1.0000 2.0000 3.0000 4.0000 3.8333 6.0000 7.0000 >>...

ungefär 20 timmar ago | 0

Answered

Normality test of the Matlab function 'randn'

I always use the Wilks-Shapiro test(*) and have little experience with Lillifors test, but some trials with various N have convi...

Normality test of the Matlab function 'randn'

I always use the Wilks-Shapiro test(*) and have little experience with Lillifors test, but some trials with various N have convi...

ungefär 20 timmar ago | 0

Answered

How to extract rows from a table using a loop to search for specific column values, and create a new table with extracted rows

Would be much easier if attached a subset of the input file or a .mat file containing the table...we have to make up stuff to tr...

How to extract rows from a table using a loop to search for specific column values, and create a new table with extracted rows

Would be much easier if attached a subset of the input file or a .mat file containing the table...we have to make up stuff to tr...

ungefär 21 timmar ago | 0

| accepted

Answered

How to quickly save a matrix by adding rows?

Yes. Preallocate the array and index into it...without context it's conjecture what you have/are doing, but the general idea is...

How to quickly save a matrix by adding rows?

Yes. Preallocate the array and index into it...without context it's conjecture what you have/are doing, but the general idea is...

ungefär 21 timmar ago | 0

| accepted

Answered

plotting data that includes '-nan(incl)'

Use tables; you'll get benefit of variable names and easier addressing for free...the "CT6" file that your function didn't read ...

plotting data that includes '-nan(incl)'

Use tables; you'll get benefit of variable names and easier addressing for free...the "CT6" file that your function didn't read ...

en dag ago | 0

| accepted

Answered

How to quickly find the indecis of an array in another array?

>> [~,ia]=find(ismember(B,A)) ia = 1 3 4 >> whether it is any faster I doubt, but it doesn't use intersect. W...

How to quickly find the indecis of an array in another array?

>> [~,ia]=find(ismember(B,A)) ia = 1 3 4 >> whether it is any faster I doubt, but it doesn't use intersect. W...

2 dagar ago | 0

Answered

How does "findpeak" work? How does it ignore the unwanted peaks?

The doc for 'MinPeakDistance' explains that it picks the tallest in the signal overall and then ignores everything else within t...

How does "findpeak" work? How does it ignore the unwanted peaks?

The doc for 'MinPeakDistance' explains that it picks the tallest in the signal overall and then ignores everything else within t...

2 dagar ago | 1

| accepted

Answered

find reverses the dimension of rows and column output vectors when input is a vector

It has always behaved to return the shape of the input -- a row vector input returns a row vector output. That is expected beh...

find reverses the dimension of rows and column output vectors when input is a vector

It has always behaved to return the shape of the input -- a row vector input returns a row vector output. That is expected beh...

2 dagar ago | 0

| accepted

Answered

How to find multiple table column numbers by column names?

col_ind_rmt = find(string(G_Value.Properties.VariableNames) == "rk_mill_tonnage" || 'ore_mill_tonnage'); Just replace "||" with...

How to find multiple table column numbers by column names?

col_ind_rmt = find(string(G_Value.Properties.VariableNames) == "rk_mill_tonnage" || 'ore_mill_tonnage'); Just replace "||" with...

2 dagar ago | 0

Answered

How to use splitappy for only 10 rows in each group?

You can't (at least without more machinations than I'd care to even attempt) do that with an anonymous function, but since the r...

How to use splitappy for only 10 rows in each group?

You can't (at least without more machinations than I'd care to even attempt) do that with an anonymous function, but since the r...

2 dagar ago | 0

| accepted

Answered

What happens when a custom made function needs an input for every evaluation in an iteration while optimising the function ?

I created a testing function that mimicked one just used in another Q? -- function T=testit(x) persistent c if isempty(c)...

What happens when a custom made function needs an input for every evaluation in an iteration while optimising the function ?

I created a testing function that mimicked one just used in another Q? -- function T=testit(x) persistent c if isempty(c)...

2 dagar ago | 0

Answered

Double y-axis with synchronized to each other

You can scale the percentile axis from [0 0.8] to match the [0 8] range on the other axes; if you scale to percentages, then you...

Double y-axis with synchronized to each other

You can scale the percentile axis from [0 0.8] to match the [0 8] range on the other axes; if you scale to percentages, then you...

3 dagar ago | 0

Answered

Plot points that meet a specific condition by using a function

num=table2array(D(:,1)); id=table2array(D(:,2)); Err=table2array(D(:,3)); slope=table2array(D(:,4));xnum=find(num==1); xnum=...

Plot points that meet a specific condition by using a function

num=table2array(D(:,1)); id=table2array(D(:,2)); Err=table2array(D(:,3)); slope=table2array(D(:,4));xnum=find(num==1); xnum=...

4 dagar ago | 0

Answered

Using fzero to keep tolerance within limits

As the error message says, you need a function name/handle as the argument to fzero not just an expression. >> fn=@(T)100*(0.15...

Using fzero to keep tolerance within limits

As the error message says, you need a function name/handle as the argument to fzero not just an expression. >> fn=@(T)100*(0.15...

4 dagar ago | 0

| accepted

Answered

Error using plot Vectors must be the same length.

On the right track, just have to use the index for both variables... index_liq = (M_CP==2); % index to...

Error using plot Vectors must be the same length.

On the right track, just have to use the index for both variables... index_liq = (M_CP==2); % index to...

4 dagar ago | 0

Answered

Running all Nastran input .bdf files contained in a folder using Matlab

files = dir('*.bdf'); for i = 1 : length(files) filename = files(K).name; system('D:\MSC.Software\MSC_Nastran\20180\bin\n...

Running all Nastran input .bdf files contained in a folder using Matlab

files = dir('*.bdf'); for i = 1 : length(files) filename = files(K).name; system('D:\MSC.Software\MSC_Nastran\20180\bin\n...

4 dagar ago | 1

Answered

Detrending a time series with NaN values

With recent (but I'm not sure just how recent) releases, there's the 'omitnan' optional parameter in detrend that will skip the ...

Detrending a time series with NaN values

With recent (but I'm not sure just how recent) releases, there's the 'omitnan' optional parameter in detrend that will skip the ...

5 dagar ago | 0

| accepted

Answered

Error using chckxy: The first input must contain unique values, while using only unique values

>> load dados >> whos x y Name Size Bytes Class Attributes x 1x58 464 double...

Error using chckxy: The first input must contain unique values, while using only unique values

>> load dados >> whos x y Name Size Bytes Class Attributes x 1x58 464 double...

5 dagar ago | 0

| accepted

Answered

How to convert memory to Megabyte

>> m=memory; >> sprintf('%.0f MB',m.MemUsedMATLAB/(1024^2)) ans = '2305 MB' >>

How to convert memory to Megabyte

>> m=memory; >> sprintf('%.0f MB',m.MemUsedMATLAB/(1024^2)) ans = '2305 MB' >>

5 dagar ago | 0

| accepted

Answered

How do I set the some letters in an Excel sheet cell to 'BOLD' through ACTXSERVER using MATLAB (R2019a)?

This isn't MATLAB per se, but Excel VBA/object model syntax Q? A sample VBA function would look something like lngPos = InStr(...

How do I set the some letters in an Excel sheet cell to 'BOLD' through ACTXSERVER using MATLAB (R2019a)?

This isn't MATLAB per se, but Excel VBA/object model syntax Q? A sample VBA function would look something like lngPos = InStr(...

5 dagar ago | 0

Answered

Generating a normal distrbution random numbers and setting them to catagories

function [abc,ABC]=random_gen(n) r=randn(n,1); % generate column vector N rn ix=disc...

Generating a normal distrbution random numbers and setting them to catagories

function [abc,ABC]=random_gen(n) r=randn(n,1); % generate column vector N rn ix=disc...

7 dagar ago | 0

Answered

Change color of numbers at colorbar

Undocumented property -- underneath is a NumericRuler object which does control the axes ticklabels independently. figure surf...

Change color of numbers at colorbar

Undocumented property -- underneath is a NumericRuler object which does control the axes ticklabels independently. figure surf...

7 dagar ago | 0

| accepted

Answered

Plot year as major ticks and months as minor ticks

If your time data are evenly-spaced and at monthly intervals, hAx=gca; hX=hAx.XAxis; % get handle to X datetime ruler...

Plot year as major ticks and months as minor ticks

If your time data are evenly-spaced and at monthly intervals, hAx=gca; hX=hAx.XAxis; % get handle to X datetime ruler...

7 dagar ago | 0

| accepted

Answered

URGENT help on TSA with tach signal

I've not used it, but doc (and error message) indicate that the time pulse input is either a fixed scalar or increasing time for...

URGENT help on TSA with tach signal

I've not used it, but doc (and error message) indicate that the time pulse input is either a fixed scalar or increasing time for...

7 dagar ago | 0

| accepted

Answered

plotting group size vs total member in group of particular size

v =[1 1 1 2 2 3 4 4 5]; % engine u=unique(v); ng=histc(v,u); U=unique(ng) U = 1 2 3 NU=histc(ng,U) ans ...

plotting group size vs total member in group of particular size

v =[1 1 1 2 2 3 4 4 5]; % engine u=unique(v); ng=histc(v,u); U=unique(ng) U = 1 2 3 NU=histc(ng,U) ans ...

7 dagar ago | 0

| accepted

Answered

Convert a Complex Number to exponential real

MATLAB has builtin functions abs (or hypot()) and angle() for the above explicit implementations... >> x=complex(2,5); >> cm...

Convert a Complex Number to exponential real

MATLAB has builtin functions abs (or hypot()) and angle() for the above explicit implementations... >> x=complex(2,5); >> cm...

7 dagar ago | 1

Answered

Extracting elements from one matrix and placing in another

MATLAB assigns the complete array to the LHS without having used subscrpting to indicate you want to place each plane extracted ...

Extracting elements from one matrix and placing in another

MATLAB assigns the complete array to the LHS without having used subscrpting to indicate you want to place each plane extracted ...

7 dagar ago | 1

Answered

Listing C: folder contents

"The dir command in the Windows command shell behaves in this way, but that's no reason for the MATLAB command to do the same th...

Listing C: folder contents

"The dir command in the Windows command shell behaves in this way, but that's no reason for the MATLAB command to do the same th...

8 dagar ago | 0