Help with division on a cell array

6 ビュー (過去 30 日間)
Ian
Ian 2013 年 2 月 28 日
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
  1 件のコメント
Ian
Ian 2013 年 2 月 28 日
Perfect, thank you so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by