Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element

2 次查看(过去 30 天)

packet_allocated_bandwidth = 0; This line of code was initially given as zero. So when I assigned 200 to packet allocated bandwidth of the next connection,it displays the error given below. NextConnection.packet_allocated_bandwidth = 200; This line of code displays the following error: Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element. Please what does it want me to do? Help is needed. Thanks in advance

采纳的回答

Matt J
Matt J 2024-2-6
if ~isempty(NextConnection)
NextConnection.packet_allocated_bandwidth = 200;
else
...something else
end
  5 个评论
izuchukwu
izuchukwu 2024-2-7
After inserting the lines of codes you suggested for me, it displays nextconnection is empty, immediately the simulation stopped. Please what should I do to make the nextconnection not to be empty?
Walter Roberson
Walter Roberson 2024-2-7
We have no information about what NextConnection is, or the circumstances under which it is changed, so we are not able to offer any advice as how to make it not be empty.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by