Help with division on a cell array

1 次查看(过去 30 天)
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

采纳的回答

Image Analyst
Image Analyst 2013-2-28
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by