# Import values having different units in matlab

1 visualizzazione (ultimi 30 giorni)
Anshul Jain il 8 Dic 2021
Risposto: Mrinal Anand il 8 Lug 2023
Dear sir,
I have three parameters Ez, Bx and By with some finite values of each of them.
Ez is in "mm" while Bx and By are in "degree".
I want to plot volume plot between them as a 3-D plot. (though they have different units)
I am using the following code for that and getting a 3-D plot:
T = table2array(T);
Ez=T(:,1);
Bx=T(:,2);
By=T(:,3);
plot3(Ez,Bx,By,'.');
kkk=boundary(Bx,By,Ez);
trisurf(kkk,Bx,By,Ez,'Facecolor','r');
xlabel('Bx(deg)');
ylabel('By(deg)');
zlabel('Ez(mm)');
Now, my concern is : Ez is in 'mm ' and Bx and By are in degree, but the plot I am getting will be in cartesian cordinate..? (Sorry, I am not aware but my anticipation is that the Matlab uses cartesian coordinate system to plot, until unless specified).
The values of Bx and By are in degrees but how does this code will know that they are in degrees? It might considering their values in "mm" only if MATLAB uses cartesian coordinate system.
So, please let me know how to make understand the code that two values are in degrees and one in mm? or how to import the degree values in matlab? (since I am directly importing them just like Ez which is in mm).
An excel file is attached here for the reference.
Thanks and regards,
Anshul Jain
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

Mrinal Anand il 8 Lug 2023
Matlab plotting functions assume that the plotting data is given in Cartesian coordinates by default. So you need to convert your angle data to Radians before plotting. Here are the modifications you should make to your code:
Your code should then plot the correct figure.
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by