Question

How can one display fitting equations (with t stat and R^2) on a scatter plot

I use scatter(x,y) for a scatter plot. Then I run fitlm(x,y) Then I want to display the result of regression equations, t-s...

1 day ago | 1 answer | 0

Question

How to program plots with models starting with table

https://www.mathworks.com/help/stats/linearmodel.plot.html provides a code example with loading dataset load carsmall Year =...

1 day ago | 0 answers | 0

Question

how to remove a row that contains inf from a table

https://www.mathworks.com/help/matlab/ref/rmmissing.html does not remove inf (I think they should put options to include inf). ...

2 days ago | 1 answer | 0

Question

lsline error message and how to deal with it

I try to use lsline in scatter plot. The scattor plot works fine. But for lsline I got an error message "Warning: No allowed li...

2 days ago | 1 answer | 0

Question

retime: apply different method for different columns

I have a timetable with column 2 temperature and column 3 rainfall. I want to apply mean for column 2 and variance for column 3....

3 days ago | 1 answer | 0

Question

replace [ ] in an array with 0's

https://www.mathworks.com/matlabcentral/answers/112403-how-do-i-replace-in-an-array-with-0-s talks about replace [] with 0's fo...

3 days ago | 3 answers | 0

Question

can one define a function handle in Livescript?

Can one define a function handle in Livescript? How will it work? cf.. https://www.mathworks.com/matlabcentral/answers/501199-...

3 days ago | 1 answer | 0

Question

'retime' with multiple methods?

'retime' uses a method to aggregate data TT3 = retime(TT,'hourly','mean') Is it possible to use two methods to calculate mea...

3 days ago | 1 answer | 0

Question

what are the differences between regress and fitlm?

What are the differences between regress and fitlm?

4 days ago | 0 answers | 0

Question

how can one set default fonts for plots?

I tried set(groot,'defaultFontName','Times New Roman') but got Error using matlab.ui.Root/set fontname is an invalid class n...

4 days ago | 1 answer | 0

Answered

calculate average only for one group

https://www.mathworks.com/matlabcentral/answers/366254-how-do-i-extract-certain-data-from-a-table

calculate average only for one group

https://www.mathworks.com/matlabcentral/answers/366254-how-do-i-extract-certain-data-from-a-table

4 days ago | 0

Question

calculate average only for one group

I have a table T YYYY Name Location Income ----------------- 2020 A E 300K 2020 B W 250K 2020 C E 400K 2020 D W 300K Then...

4 days ago | 2 answers | 0

Question

take averages of obvervations for each month

suppose I have a table S date income ---------------------------- 1/1/2020 100 1/2/2020 20 I want to cr...

5 days ago | 1 answer | 0

Question

unstack warnings about variable names

I ran unstack and got Warning: Table variable names that were not valid MATLAB identifiers have been modified. Since table v...

5 days ago | 2 answers | 0

Question

how to set a frequency of x axis of a plot?

I have a plot plot(yyyyMM,temperature) This plot has x axis that shows year. But I want to have more fine ticks such as quate...

5 days ago | 2 answers | 0

Question

what are the functions that one can use for unstack aggregate functions?

I use unstack to create a pivot table. https://www.mathworks.com/help/matlab/ref/unstack.html what are the functions that one...

5 days ago | 1 answer | 0

Question

how to transfer a setting from an old version to a new version

I have 2019b and installed a newer 2020a in a same PC. How can one transfer a setting (path, etc) of 2019b to 2020a? Then, how c...

7 days ago | 1 answer | 0

Question

Unstack: how to create a pivot table like this?

I have a table like (the real table is more complicated) date month person spending -------------------------- 1/1/2020 Janua...

7 days ago | 1 answer | 0

Question

how to use saveas specify the size of plot when one save the plot

I want to save plot to fit to the size of slides. How can one use saveas (or another command) to save a plot in a 16:9 ratio (or...

7 days ago | 1 answer | 0

Question

how to user grpstats function in this case

I have a table like (the real table is more complicated) date month person spending 1/1/2020 January-2020 John 30 1/1/2020 Ja...

7 days ago | 1 answer | 0

Question

plot of a string vector vs numeric vector, v2

Bulding on https://www.mathworks.com/matlabcentral/answers/10230-plot-of-a-string-vector-vs-numeric-vector I was able to crea...

7 days ago | 0 answers | 0

Question

plot with string value in x axis

I have a data date temperate ---- '2020-01' 10 '2020-02' 10 '2020-03' 20 I tried plo...

7 days ago | 0 answers | 0

Question

strcmp for a part of the word

I understand strcmp(A,B) compares strings A and B. But suppose I have 'Toyota 2020', 'Toyota 2019',... and I want to check whe...

8 days ago | 1 answer | 0

Question

some numbers expressed as date when downloaded as xlsx file

I created some numbers in a table and downloaded the table into xlsx using writetable function. Then some numbers are displayed ...

8 days ago | 1 answer | 0

Question

Month as a two digit number

I have month(Date); this will give me the number 1,2,3,... But I want to have 01,02,03,.. as months. Please advise.

8 days ago | 2 answers | 0

Question

livescript: move to next section

I have Livescript and I have sections. I know "Run Section" "Run and Advance" ”Run to the End" What I would like to do is ...

8 days ago | 1 answer | 0

Question

create yyyymm variable from date

I have a date variable. I want to create yyyymm from the date variable. I can use the year function and the month function to ex...

11 days ago | 1 answer | 0

Question

How to create a pivot table

I have a table date person spendings ---------------------------------------- 1/1/2020 John $100 1/1/2020...

11 days ago | 1 answer | 0

Question

create a variable and specify its column

Suppose I have a table day temperature 1/1/2020 30 I want to create a vaiable 'month" from 'day' and put it ...

12 days ago | 2 answers | 0

Question

How to define a new variable in a table, Part 3

I have a table test date breakfast lunch 1/2/2020 10 20 1/3/2020 5 25 1/4/2020 8 20 Just for the sake of an exmple, I wa...

21 days ago | 1 answer | 0