Borrar filtros
Borrar filtros

Hello, I receive this error

1 visualización (últimos 30 días)
Antonis Marinou
Antonis Marinou el 11 de Oct. de 2017
Comentada: Antonis Marinou el 11 de Oct. de 2017
Hello, I have a folder and i have inside two m files and three .xlsx excel files. My first code 'Graph_Preprocessing_and_Visualization' works fine. Now, i want with some way to run my first script as a function in my second code 'Simulink_Configuration_Model'. My function in the second code has the same name with my first code. Here is my code:
set(0,'RecursionLimit',2000)
clear
close_system
clc
%%%Open simulink model
fic1='filname'
new_system('filname')
open_system('filname')
%%%Set Graph_Preprocessing_and_Visualization function parameters
bus_filename='Buscoords.xlsx';
lines_filename='Lines.xlsx';
loads_filename='Loads.xlsx';
Visualization_flag=1;
% Generate the new reduced system
[Bus_final,lines_final,line_type,Adjacency_matrix]=Graph_Preprocessing_and_Visualization(bus_filename,lines_filename,loads_filename,Visualization_flag)
A_ini=Bus_final; %%%Bus Final
Lines=lines_final(:,1:2) %%%Lines Final only the connections without the length
Here is my error:
Attempt to execute SCRIPT
Graph_Preprocessing_and_Visualization as a
function:
C:\Users\user\Desktop\mtlb\bin\New
folder2\Graph_Preprocessing_and_Visualization.m
Error in Simulink_Model_Configuration
<<>>
(line 16)
[Bus_final,lines_final,line_type,Adjacency_matrix]=Graph_Preprocessing_and_Visualization(bus_filename,lines_filename,loads_filename,Visualization_flag)

Respuesta aceptada

GEEVARGHESE TITUS
GEEVARGHESE TITUS el 11 de Oct. de 2017
When the problem is because ofexecuting the line [Bus_final,lines_final,line_type,Adjacency_matrix]=Graph_Preprocessing_and_Visualization(bus_filename,lines_filename,loads_filename,Visualization_flag)
It seems you have not defined the function Graph_Preprocessing_and_Visualization prior.
  3 comentarios
Walter Roberson
Walter Roberson el 11 de Oct. de 2017
You do already have
C:\Users\user\Desktop\mtlb\bin\New folder2\Graph_Preprocessing_and_Visualization.m
on your path, but it is not coded as a function file.
You should check whether C:\Users\user\Desktop\mtlb\bin\New folder2\Graph_Preprocessing_and_Visualization.m happens to be on your path by accident, or whether it is some junk file that you can delete, or if you accidentally tried to use the same name Graph_Preprocessing_and_Visualization for two different purposes
Antonis Marinou
Antonis Marinou el 11 de Oct. de 2017
Thank you very much, you are absolutely right, i did not coded my first code as a function. Now it is working! Thank you mr Walter Roberson

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Environment Customization en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by