MATLAB Answers

performing a function to a column in a table

44 ビュー (過去 30 日間)
Yasmin Samy
Yasmin Samy 2017 年 11 月 30 日
回答済み: Jerry 2020 年 1 月 7 日
Hello, I have a table where GroupingVariables is month. It has 3 columns, the month, the groupcount, and the mean. I would like to get the exponential of just the third column of the table. How can that be done without having to extract the column and use horzcat? i used varfun to get the mean, so the columns have names. Thanks.

  3 件のコメント

Yasmin Samy
Yasmin Samy 2017 年 11 月 30 日
I tried using the command below
Fine_avg = varfun(@exp,Fine_avg,'InputVariables','mean_Fine_pearllog');
it gives the correct values, but then removes the first two column. :/
Walter Roberson
Walter Roberson 2017 年 11 月 30 日
Do individual table entries have multiple values? If not then
Fine_avg.mean_file_perl = exp(Fine_avg.mean_File_pearllog);
Yasmin Samy
Yasmin Samy 2017 年 11 月 30 日
Thanks! that`s perfect!

Sign in to comment.

回答 (1 件)

Jerry 2020 年 1 月 7 日
You can assign back your calculation to the original table like this:
Fine_avg(1:end, 'mean_Fine_pearllog') = varfun(@exp,Fine_avg,'InputVariables','mean_Fine_pearllog');

  0 件のコメント

Sign in to comment.

Translated by