Borrar filtros
Borrar filtros

Using feedforwardnet in python API

5 visualizaciones (últimos 30 días)
Yannik Nelson
Yannik Nelson el 26 de Feb. de 2022
Respondida: Aditya el 16 de Oct. de 2023
Hi i'd like to use the matlab feedforwardnet objection from python, but when i try and create it i get the error:
only 1xN and Nx1 cell arrays can be returned from MATLAB
Here is the relevant code section:
import matlab.engine
import matplotlib.pyplot as plt
import numpy as np
eng = matlab.engine.start_matlab()
ffnet = eng.feedforwardnet(20.0)

Respuestas (1)

Aditya
Aditya el 16 de Oct. de 2023
Hi Yannik,
I understand that you are encountering an error when calling the ‘feedforwardnet’ function from MATLAB using python.
It seems the error is due to the line:
ffnet = eng.feedforwardnet(20.0)
To resolve this issue, you can modify the code as follows:
layer_size = matlab.double(20)
ffnet = eng.feedforwardnet(layer_size)
I also found a similar query on MathWorks community that you can refer to for additional guidance:
Hope this helps!

Categorías

Más información sobre Image Data Workflows en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by