Help with division on a cell array

1 vue (au cours des 30 derniers jours)
Ian
Ian le 28 Fév 2013
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

Réponse acceptée

Image Analyst
Image Analyst le 28 Fév 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
  1 commentaire
Ian
Ian le 28 Fév 2013
Perfect, thank you so much!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by