Answered

How to change a line in .txt file by importing a name, from a loop

OK, given a row and text to be in said row in the alternate file, that's pretty simply done--I'll also illustrate the newfangled...

How to change a line in .txt file by importing a name, from a loop

OK, given a row and text to be in said row in the alternate file, that's pretty simply done--I'll also illustrate the newfangled...

ungefär 8 timmar ago | 0

Answered

Forming loop to perform same action

Thres = 0.17; istrue1=((x>= 928 & x<=1139) & y>=Thres) | ... ((x>=2527 & x<=2856) & y>=Thres) | ... ((x>=4113...

Forming loop to perform same action

Thres = 0.17; istrue1=((x>= 928 & x<=1139) & y>=Thres) | ... ((x>=2527 & x<=2856) & y>=Thres) | ... ((x>=4113...

ungefär 11 timmar ago | 0

| accepted

Answered

how to store even and odd strings into 2 seperate vectors using mod function

Whassup w/ this thing about alternative storage of odd/even indices all of a sudden??? <Answers/514742-how-to-separate-an-array...

how to store even and odd strings into 2 seperate vectors using mod function

Whassup w/ this thing about alternative storage of odd/even indices all of a sudden??? <Answers/514742-how-to-separate-an-array...

ungefär 12 timmar ago | 0

Answered

How to recursively add symbol in a for loop?

Don't try to catenate all with text operators; use sprintf (or possibly some of the new string class functionality that includes...

How to recursively add symbol in a for loop?

Don't try to catenate all with text operators; use sprintf (or possibly some of the new string class functionality that includes...

ungefär 13 timmar ago | 0

Answered

alternative form for find(max(x))

if rand >= gamma [~,imx]=max(A(s(1),s(2),:); a=imx; else a = randi(nodes); end

alternative form for find(max(x))

if rand >= gamma [~,imx]=max(A(s(1),s(2),:); a=imx; else a = randi(nodes); end

ungefär 14 timmar ago | 0

| accepted

Answered

How to seperate an array into two?

Not a good idea still unless is homework...there are any number of ways to do so; about as simple as any would be for i=2:2:num...

How to seperate an array into two?

Not a good idea still unless is homework...there are any number of ways to do so; about as simple as any would be for i=2:2:num...

3 dagar ago | 0

| accepted

Answered

I am working on a certain problem but the end result is a single value repeated for n elements.

Incorporating comments from the stream above in result...using your code and loop would look something like %%Task 1 %Assignin...

I am working on a certain problem but the end result is a single value repeated for n elements.

Incorporating comments from the stream above in result...using your code and loop would look something like %%Task 1 %Assignin...

3 dagar ago | 0

| accepted

Answered

How can I randomly select a subset of logicals?

Nmatch=20; % don't bury data in code; use variables for a variable factor isM=find(v); % population of indices that mat...

How can I randomly select a subset of logicals?

Nmatch=20; % don't bury data in code; use variables for a variable factor isM=find(v); % population of indices that mat...

4 dagar ago | 0

Answered

FFT using excel data

0Hz is the DC component...if your signal is not zero mean, then the mean will be the DC component. To eliminate it, subtract ...

FFT using excel data

0Hz is the DC component...if your signal is not zero mean, then the mean will be the DC component. To eliminate it, subtract ...

4 dagar ago | 1

Answered

how do I extract time series?

>> which time C:\ML_R2019b\toolbox\matlab\bigdata\@tall\time.m % tall method >> which day C:\ML_R2019b\toolbox\matlab\timefu...

how do I extract time series?

>> which time C:\ML_R2019b\toolbox\matlab\bigdata\@tall\time.m % tall method >> which day C:\ML_R2019b\toolbox\matlab\timefu...

5 dagar ago | 0

| accepted

Answered

From nested structure to table in one line of code

Will need some additional cleanup, but the basic tranformation is as >> T=struct2table(struct2array(S)); >> T(1:10,:) ans = ...

From nested structure to table in one line of code

Will need some additional cleanup, but the basic tranformation is as >> T=struct2table(struct2array(S)); >> T(1:10,:) ans = ...

5 dagar ago | 0

| accepted

Answered

Negative zero when writing to file

The problem is one of rounding/floating point precision. The cos(3*pi/2) is mathematically zero, indeed, but it isn't quite so ...

Negative zero when writing to file

The problem is one of rounding/floating point precision. The cos(3*pi/2) is mathematically zero, indeed, but it isn't quite so ...

5 dagar ago | 1

Answered

Import files from a folder into Matlab and create a file list

d=dir('*.json'); for i=1:numel(d) vals{i} = jsondecode(fileread(d(i).name)); ...

Import files from a folder into Matlab and create a file list

d=dir('*.json'); for i=1:numel(d) vals{i} = jsondecode(fileread(d(i).name)); ...

5 dagar ago | 0

| accepted

Answered

Finding yearly average of data in a matrix

Of course there is..."grouping variables" [meanByYear,yr,yrcounts]=groupsummary(iceArea(:,2),iceArea(:,1),'mean');

Finding yearly average of data in a matrix

Of course there is..."grouping variables" [meanByYear,yr,yrcounts]=groupsummary(iceArea(:,2),iceArea(:,1),'mean');

5 dagar ago | 0

| accepted

Answered

Finding full graph / minimum without an x range

Well, with such disparate magnitudes in terms, the interesting part is somewhat harder to envision...the second part goes to +in...

Finding full graph / minimum without an x range

Well, with such disparate magnitudes in terms, the interesting part is somewhat harder to envision...the second part goes to +in...

6 dagar ago | 0

Answered

extracting a and b beta parameters from distribution fitter app

If your save object is mybetaObject then myBetaObject.ParameterValues % both a, b or myBetaObject.a myBetaO...

extracting a and b beta parameters from distribution fitter app

If your save object is mybetaObject then myBetaObject.ParameterValues % both a, b or myBetaObject.a myBetaO...

7 dagar ago | 0

| accepted

Answered

How to arrange month columns based on date code is run?

vnames=month(datetime(1,[1:12],1),'short'); % return dummy variable names containing short month names % engine >> circsh...

How to arrange month columns based on date code is run?

vnames=month(datetime(1,[1:12],1),'short'); % return dummy variable names containing short month names % engine >> circsh...

10 dagar ago | 0

| accepted

Answered

Function overwrites output with a different number

Besides the refactoring and code mlint suggestions removal, I think the biggest problem is the function definition line functio...

Function overwrites output with a different number

Besides the refactoring and code mlint suggestions removal, I think the biggest problem is the function definition line functio...

13 dagar ago | 0

| accepted

Answered

How to decipher date formats?

"Is it possible to get their [variant input and ambiguous formats - sic] datenum correctly in a holistical way?" "Possible?" M...

How to decipher date formats?

"Is it possible to get their [variant input and ambiguous formats - sic] datenum correctly in a holistical way?" "Possible?" M...

14 dagar ago | 0

| accepted

Answered

Errorbar Plot with Line of best fit

S-S is correct that per the documentation lsline only works for scatter plots or not connected lines with plot Perhaps just a l...

Errorbar Plot with Line of best fit

S-S is correct that per the documentation lsline only works for scatter plots or not connected lines with plot Perhaps just a l...

15 dagar ago | 0

Answered

How to remove dates in graph ?

The error ax.XAxis.TickValues=1:10:length(NewP{:,"Date"}) Error using matlab.graphics.axis.decorator.DatetimeRuler/validateTic...

How to remove dates in graph ?

The error ax.XAxis.TickValues=1:10:length(NewP{:,"Date"}) Error using matlab.graphics.axis.decorator.DatetimeRuler/validateTic...

16 dagar ago | 0

Answered

How to find a particular value from 3-d matrix?

If you're certain the value 1.75 exactly exists in the file and that's all you want exactly (to machine precision) then simply ...

How to find a particular value from 3-d matrix?

If you're certain the value 1.75 exactly exists in the file and that's all you want exactly (to machine precision) then simply ...

17 dagar ago | 1

Answered

how to read and create column vectors from this txt file (attached)?

A fixedWidthImportOptions object can help here altho the heading row doesn't quite line up to make it as trivial as could otherw...

how to read and create column vectors from this txt file (attached)?

A fixedWidthImportOptions object can help here altho the heading row doesn't quite line up to make it as trivial as could otherw...

17 dagar ago | 0

| accepted

Answered

Bar graph for two different arrays

Didn't read doc bar did you? It'll take 1:5 on the x-axis but bar([a;b].')

Bar graph for two different arrays

Didn't read doc bar did you? It'll take 1:5 on the x-axis but bar([a;b].')

18 dagar ago | 0

| accepted

Answered

Removing NaN in Linear Regression Problem. Error in line 66.

You don't pass the table to regress but the variables to be used in the regression -- then you won't run into the issue inside r...

Removing NaN in Linear Regression Problem. Error in line 66.

You don't pass the table to regress but the variables to be used in the regression -- then you won't run into the issue inside r...

18 dagar ago | 0

| accepted

Answered

Reordering string arrays if string is >9

<ileexchange/10959-sort_nat-natural-order-sort>

Reordering string arrays if string is >9

<ileexchange/10959-sort_nat-natural-order-sort>

18 dagar ago | 1

Answered

read coordinate from a txt file

textscan is overkill for a simple csv file of the above form -- controlpoints=importdata('YOURTEXTFILE.CSV'); and you'll have ...

read coordinate from a txt file

textscan is overkill for a simple csv file of the above form -- controlpoints=importdata('YOURTEXTFILE.CSV'); and you'll have ...

18 dagar ago | 1

| accepted

Answered

Convert cell array to double, with comma separated elements

>> v=cell2mat(cellfun(@(s) sscanf(s,'%f,').',c,'UniformOutput',false)) v = 126.5000 250.5000 22.0000 27.0000 127.500...

Convert cell array to double, with comma separated elements

>> v=cell2mat(cellfun(@(s) sscanf(s,'%f,').',c,'UniformOutput',false)) v = 126.5000 250.5000 22.0000 27.0000 127.500...

18 dagar ago | 1

Answered

Trouble adding error bars to bar graph

<Answers/379570-how-can-i-place-my-error-bar-in-separate-bar-center> <Answers/359237-how-do-i-label-each-bar-in-bar-group-with-...

Trouble adding error bars to bar graph

<Answers/379570-how-can-i-place-my-error-bar-in-separate-bar-center> <Answers/359237-how-do-i-label-each-bar-in-bar-group-with-...

18 dagar ago | 0

| accepted

Answered

Create a maxtrix of row x columns and add values (column-wise) in a loop

Comment moved to Answer since did seem to be the Q? asked... j=0; % initialize other array counter ...

Create a maxtrix of row x columns and add values (column-wise) in a loop

Comment moved to Answer since did seem to be the Q? asked... j=0; % initialize other array counter ...

19 dagar ago | 1