How do I write this expression in matlab?

조회 수: 1 (최근 30일)
cakey
cakey 2014년 9월 24일
답변: Image Analyst 2014년 9월 27일
How do I write this expression in matlab?
a(n)=sqrt(a(n-1))*(n+1)^(1/(2*k))
  댓글 수: 1
Jan
Jan 2014년 9월 27일
This is a Matlab expression already.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2014년 9월 27일
Just assign a(1) and put that expression in a for loop from 2 to whatever.
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
imtool close all; % Close all imtool figures if you have the Image Processing Toolbox.
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 40;
a(1) = 1;
k = 3; % Whatever.
for n = 2 : 30
a(n) = sqrt(a(n-1))*(n+1)^(1/(2*k));
end
plot(1:length(a), a, 'b*-', 'LineWidth', 2, 'MarkerSize', 15);
xlabel('n', 'FontSize', fontSize);
ylabel('a', 'FontSize', fontSize);
ylim([0,4]);
grid on;
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by