MATLAB Answers

Error occured while importing ensemble table to diagnostic feature designer

조회 수: 3(최근 30일)
Shabeeh Abbas
Shabeeh Abbas 28 Mar 2021
답변: Xiaoxing Wang 6 Apr 2021
MAF and O2 are the sensors i'm using in my project and i have made ensemble table of which includes timetables of MAF and O2 sensors along with a column of fault codes as directed in the documentation. But as soon as i'm importing the table in the diagnostic feature designer i'm not able to obtain the source variable pane as shown by the documentation, image given below. Plz can anyone help me with this i'm worried
  댓글 수: 1
Shabeeh Abbas
Shabeeh Abbas 28 Mar 2021
I also tried to change the essemble table into an array to resolve the problem but the following error popped up
"Error using table2array (line 37)
Unable to concatenate the table variables 'MAF' and 'Faultcode', because their types are cell and

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


Xiaoxing Wang
Xiaoxing Wang 6 Apr 2021
The icons tell that your inputs 'Data', 'o2', and 'Faultcode' are independent variables.
You need to reconstruct 'Data' and 'o2' to match Data variables, and 'Faultcode' to match Condition variables so that your MAF and O2 become 'Signal data'.
You can import 'sampleData' as shown below to identify the difference between data types, i.e. icons.
clear; clc;
format short;
format compact;
close all;
%% Data preparation; two channels and 3 classes for faultCode
measurementLength = 100;
measurementDays = 50;
% Initialization
sz = [measurementDays,3];
varTypes = {'datetime','cell','categorical'};
varNames = {'date','data','faultCode'};
sampleData = table('Size',sz,'VariableTypes',varTypes,'VariableNames',varNames);
% Timestamp
dateval = datetime('now','Format','yyyy/MM/dd');
% faultCode
A = randi(3,measurementDays,1);
faultCode = categorical(A,[1,2,3],{'x','y','z'});
for day = 1:measurementDays
%* Generate timetable
var1 = rand(measurementLength,1);
var2 = rand(measurementLength,1);
measurementTime = seconds(1:measurementLength);
measurementTime = measurementTime(:);
tt = timetable(measurementTime, var1, var2);
%* Encapsulate timetable to table
dateval = dateval+days(day-1); = dateval; = {tt};
sampleData.faultCode(day) = faultCode(day);

Community Treasure Hunt

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

Start Hunting!

Translated by