how to transform files drom double to struct

5 visualizaciones (últimos 30 días)
ELISABETTA BILLOTTA
ELISABETTA BILLOTTA el 1 de Jul. de 2022
Respondida: Balaji Udayagiri el 5 de Jul. de 2022
Eric Sofen ha marcado con alerta este/a pregunta
i need to estrapolate data from matlab and use them in Qgis.
I need shapefile data and with shapewrite it doesn't work.
contourf(XX,YY,ZZ,100,'linecolor','none'); where XX,YY,ZZ are 181x151 double
qgis1=contourf(XX,YY,ZZ,100,'linecolor','none'); where qgis1 is 2x2479 double
shapewrite(qgis1,"contour_5km.shp");
i had a plot with contourf and this error:
Error using shapewrite
Expected input number 1, S, to be one of these types:
struct, table, mappoint, geopoint, mapshape, geoshape
Instead its type was double.
So, is there a method to convert a matrix double to a struct and obtain always a contourf graph?
Can anyone help me?
thanksss

Respuestas (1)

Balaji Udayagiri
Balaji Udayagiri el 5 de Jul. de 2022
Hi Elissabetta
As per my understanding, you want to convert your double data into a datatype which is a valid input to shapewrite() function.
Since, shapewrite() function takes a table as input. I recommend using the array2table() function to convert the variable to table.
Alternatively, you can also look at this solution to convert it to a struct: https://in.mathworks.com/matlabcentral/answers/6501-convert-double-array-to-structure-array-for-use-in-shapewrite-fxn

Categorías

Más información sobre Earth and Planetary Science en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by