Filter löschen
Filter löschen

Why do I get " Unable to resolve the name Mdl1b.Partition"

4 Ansichten (letzte 30 Tage)
Achouak Madani
Achouak Madani am 31 Jul. 2021
Bearbeitet: Walter Roberson vor etwa 14 Stunden
I keep getting "Unable to resolve the name Mdl1b.Partition" everytime I read all lines of the Excel file (1000 lines) but when I limit the lines to read to 50 or so it works perfectly. I do not know why doesn't matlab read all the lines? is there a limit to the lines matlab reads?
%reading and defining X and Y
datmi=xlsread('Significant desc.xlsx');
X=datmi(2:100,4:51);
Y=datmi (2:100,2);
%deviding the result data to train and test to draw graphs (which causes the error only when reading all the lines)
cvp=Mdl1b.Partition
The error I get
Error in ploting_ruselt (line 1)
cvp=Mdl1b.Partition
Error in ssvm (line 44)
ploting_ruselt

Antworten (1)

Arjun
Arjun am 26 Aug. 2024 um 11:13
I understand that you are encountering an error message: ‘Unable to resolve the name Mdl1b.Partition’ and you suspect that there is something related to loading data from an Excel file which is causing such a behaviour.
However, this issue is likely not related to the number of lines you are reading from the Excel file, but rather to how Mdl1b is defined or used in your code. The error message ‘Unable to resolve the name Mdl1b.Partition’ suggests that MATLAB is unable to find or access the Partition property of Mdl1b.
Here are some steps to help you troubleshoot and resolve the issue:
  1. Check the Definition of Mdl1b: Ensure that Mdl1b is properly defined and initialized before you attempt to access its Partition property. If Mdl1b is a model object (e.g., from a machine learning toolbox), it should be created using appropriate functions such as “fitcsvm”, “fitctree”, etc.
  2. Verify the Existence of the Partition Property: Ensure that the Mdl1b object has a Partition property. Not all model objects have this property. If Mdl1b is a cross-validated model (e.g., created with 'CrossVal', 'on'), it should have a Partition property.
  3. Inspect the Model Creation Process: Make sure that Mdl1b is created in a way that supports cross-validation if you intend to use the Partition property. If you are performing cross-validation manually, you may need to create the partition separately using “cvpartition”.
  4. Check for Overwriting or Scope Issues: Ensure that Mdl1b is not being overwritten or modified before accessing its properties. Also, check if Mdl1b is being defined in a different scope (e.g., inside a function) and is not accessible where you are trying to use it.
By ensuring that Mdl1b is properly defined and initialized with the correct properties, you should be able to resolve the error. The issue is not likely related to the number of lines you're reading from the Excel file, but rather with how Mdl1b is being used in your code.
I hope that the suggestions mentioned above will help!

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by