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

1 view (last 30 days)
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 Comment
Image Analyst
Image Analyst on 22 Nov 2022
Edited: Image Analyst on 22 Nov 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?

Sign in to comment.

Answers (1)

Prateek
Prateek on 25 Nov 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

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!