Borrar filtros
Borrar filtros

I wamt to generate spheres with different diameters and display it in a single image one below the other

1 visualización (últimos 30 días)
clc;
clear all;
close all;
data = csvread("Trial1.CSV");
x = data(:,1);
y = data(:,2);
figure;
plot(x,y);
figure;
[X,Y,Z] = sphere;
surf(X,Y,Z)
axis equal
hold on
for r = y;
for j = 1:4:12
X2 = X*r;
Y2 = Y*r;
Z2 = Z*r;
surf(X2, Y2, Z2)
end
end
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To operate on each element of the matrix
individually, use TIMES (.*) for elementwise multiplication.
I have a signal that was obtained from a sensor. I want to use the signal's changing value to generate spheres and display the spheres one below the other. Please find the signal below and the output that I expect to have.
P.S. I am very new to matlab, so please let me know if I need to provide any more information
  1 comentario
Image Analyst
Image Analyst el 22 de Nov. de 2022
Editada: Image Analyst el 22 de Nov. de 2022
Try the viscircles function
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
I'm not sure how your signal relates to a sphere, like what does it have to do with a sphere or multiple sphere's radius or center location?

Iniciar sesión para comentar.

Respuestas (1)

Prateek
Prateek el 25 de Nov. de 2022
Hello Aditya,
For better assistance, could you elaborate on your requirements? Please do include the relationship between the sphere dimensions (X,Y and Z in your code) and the sensor data (x and y in your code).
Regards,
Prateek

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by