function [Out]=combineField(A,B)
% Combine two structure variables into one
% A and B are stuructures want to include both
% Out: Output.
fnames=fieldnames(B);
for is=1:length(fnames)
Data=getfield(B,fnames{is});
A=setfield(A,fnames{is},Data);
end
Out=A;
引用格式
Taesam Lee (2025). Combine two structure variables with different fields (https://ww2.mathworks.cn/matlabcentral/fileexchange/71213-combine-two-structure-variables-with-different-fields), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
创建方式
R2019a
兼容任何版本
平台兼容性
Windows macOS Linux类别
- AI and Statistics > Statistics and Machine Learning Toolbox > Descriptive Statistics and Visualization > Descriptive Statistics >
在 Help Center 和 MATLAB Answers 中查找有关 Descriptive Statistics 的更多信息
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0 |