Undefined variable using evalin

I'm trying to create a function where it returns the Temperature as a function of time from my data structure. I'm not sure where my syntax is wrong but I get an undefined varaible "Cure_Kinetics" or class "Cure_Kinetics.neat". In my Workspace, I already have the structure defined and Cure_Kinetics.neat(1).data(1,2) has a value assigned to that index.
function [ T ] = temp_program( data_file )
% Parameter inputs: i for each individual data file
% Grabs initial starting temp and ramp rate from ith data files
% Parameter outputs: Function for temperature
syms t
t_0 = evalin('base', Cure_Kinetics.neat(data_file).data(1,2));
beta = evalin('base', Cure_Kinetics.neat(data_file).ramp_rate(1,1));
T = (t_0 + t*beta);
end

답변 (1개)

Walter Roberson
Walter Roberson 2018년 2월 26일

1 개 추천

evalin(ws, expression) executes expression, a character vector or string scalar containing any valid MATLAB® expression using variables in the workspace ws

댓글 수: 3

aldburg
aldburg 2018년 2월 26일
ah, I see now why evalin() doesn't work. I read the wiki but I couldn't figure out the answer to my question.
neat = evalin('base', 'Cure_Kinetics.neat');
t_0 = neat(data_file).data(1,2);
beta = neat(data_file).ramprate(1,1);
syms t
T = t_0 + t * beta;
aldburg
aldburg 2018년 2월 26일
Thank you very much.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

태그

질문:

2018년 2월 25일

댓글:

2018년 2월 26일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by