MATLAB Answers

Anonymous function outputs to table

조회 수: 1(최근 30일)
ingeik
ingeik 11 Nov 2019
Commented: ingeik 11 Nov 2019
doublingtime = @(q) log(2)/log(1+q);
dt = doublingtime(q);
This is the relevant code. I want to make a 25x2 table which shows q values and the corresponding dt values. I want q to go from 0 to 0.25 with a step of 0.01 each time. I've tried all sorts of method to make it work, but im stuck.

  댓글 수: 0

로그인 to comment.

채택된 답변

KSSV
KSSV 11 Nov 2019
q = 0:0.01:0.25 ;
doublingtime = @(q) log(2)./log(1+q);
dt = doublingtime(q);
T = table(q,dt)

  댓글 수: 1

ingeik
ingeik 11 Nov 2019
q = 0:0.01:0.25 ;
doublingtime = @(q) log(2)./log(1+q);
dt = doublingtime(q);
T = table(q',dt', 'VariableNames', {'q', 'dt'});
disp(T)
Thank you. After just tweaking your answer a little bit, I got it to work the way I wanted!

로그인 to comment.

More Answers (0)

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by