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

1 次查看(过去 30 天)
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 个评论
Image Analyst
Image Analyst 2022-11-22
编辑:Image Analyst 2022-11-22
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?

请先登录,再进行评论。

回答(1 个)

Prateek
Prateek 2022-11-25
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

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by