Borrar filtros
Borrar filtros

How to use a 4d variable achieved from a function as a property in matlab app designer?

24 visualizaciones (últimos 30 días)
I have a function which takes few inputs and then returns some values which contain 3 variables x,y,z (all are 3d arrays) and a variable N1 which is a 4d array. I am trying to plot N1 using slice but I am getting error as there seems to be some problem when I am trying to use N1 as a property. Please help me out.
here I have tried to define Lz, yz, and zz (3d coordinates) and N1 as property. Can anyone suggest what might be the problem?

Respuestas (2)

Kanishk
Kanishk el 13 de Ag. de 2024 a las 5:50
Hi Ron,
I understand from the question you are using the slice function defined in MATLAB to extract a slice of the volume for plotting.
According to the official MATLAB documentation of the slice function and your use case, the function will take the following arguments:
  • x, y, z: Coordinate Data
  • V: Volumetric Data
  • xslice, yslice, zslice
The usage of the slice function in the code you provided is:
slice(app.Top, app.Lz , app.yz, app.zz, sum(app.N1, 4), xslice, yslice, zslice)
This does not match the documentation and is causing an error. Removing the ‘app.Top’ argument should fix the error, as it seems to be an extra argument for the function. However, since the function ‘sphere_vol’ is not available, I am unable to test this.
To learn more about the ‘slice’ please go through the following documentation:
Hope this helps!
Thanks,
Kanishk

Walter Roberson
Walter Roberson el 13 de Ag. de 2024 a las 5:56
slice() is not able to slice 4D data.
You are taking sum(app.N1,4) to reduce the data to 3D, but you are still attempting to list 4 different input coordinates

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by