Help with division on a cell array
2 views (last 30 days)
Show older comments
Hello,
I was wondering if anyone could help me with a simple question please. I'm trying to create a system where the user enters a number. The value of total_no_images is a 1x1 cell and I want to carry out general easy multiplication and division on it using / and * and I've tried ./ and .* but am having no luck. Also played with cell2mat etc functions but no luck. anyone have any ideas? I don't think its that hard im just new to this!
Many thanks
% Displays modal dialogue box with requested parameters and allows answer to
%be inputted and saved to workspace variable
total_no_images =inputdlg(prompt,title_figure,num_lines,def,options);
%Display messages to user
fprintf('Total Number of images to capture =\n');
disp(total_no_images);
%Display required angle between each image
angle = 360./total_no_images
0 Comments
Accepted Answer
Image Analyst
on 28 Feb 2013
Try this:
prompt = 'Enter number';
title = 'Enter an integer';
title_figure = 'my title';
def = {'20'};
num_lines = 1;
total_no_images =inputdlg(prompt,title_figure,num_lines,def);
total_no_images = str2num(total_no_images{1})
%Display messages to user
fprintf('Total Number of images to capture = %d\n', total_no_images);
%Display required angle between each image
angle = 360./total_no_images
More Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!