I have it reading from a struct with signal names and I want to extract it and input it into a 1 column array

5 views (last 30 days)
T = dbc.MessageInfo.Signals;
Channel= binf.ChannelList;
data1=blfData{1,1};
data2=blfData{2,1};
data3=blfData{3,1};
data4=blfData{4,1};
%j1939PGTimetable = j1939ParameterGroupTimetable(blfData,dbc)
Messages = dbc.MessageInfo;
Signals = dbc.MessageInfo.Signals;
for i = 1:length(Messages )
for j = 1:length(Messages(i).SignalInfo)
allSignals = Messages(i).SignalInfo(j).Name;
end
end
From the Signal info there is the first column called name and I access that using the dot notation and I want to create a new array to input these inside
  2 Comments
Stephen23
Stephen23 on 24 Jan 2024
Edited: Stephen23 on 24 Jan 2024
Original question from Mohamed Ali retrieved from Google Cache:
I have it reading from a struct with signal names and I want to extract it and input it into a 1 column array
T = dbc.MessageInfo.Signals;
Channel= binf.ChannelList;
data1=blfData{1,1};
data2=blfData{2,1};
data3=blfData{3,1};
data4=blfData{4,1};
%j1939PGTimetable = j1939ParameterGroupTimetable(blfData,dbc)
Messages = dbc.MessageInfo;
Signals = dbc.MessageInfo.Signals;
for i = 1:length(Messages )
for j = 1:length(Messages(i).SignalInfo)
allSignals = Messages(i).SignalInfo(j).Name;
end
end
From the Signal info there is the first column called name and I access that using the dot notation and I want to create a new array to input these inside

Sign in to comment.

Answers (1)

Stephen23
Stephen23 on 24 Jan 2024
Edited: Stephen23 on 24 Jan 2024
The solution depends on the sizes of MESSAGES and SIGNALINFO (you did not tell us either of these).
Perhaps this:
out = {Messages.SignalInfo.Name}.'
or this:
tmp = [Messages.SignalInfo];
out = {tmp.Name}.'

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!