필터 지우기
필터 지우기

Given below is a code and its output. But, I want to get the output as a 6 by 5 single matrix . how to get that?

조회 수: 1 (최근 30일)
clear; close all; clc;
format short
% These are Inputs
h=25; t(1)=0; phi(1)=0; tf=100; n=ceil((tf-t(1))/h);
t(2)=t(1)+h;t=t(1):h:tf;K=2;J=2;
a=[1.1559e-03 7.4156e-03; 1.2113e-02 1.7887e-02; 2.4226e-02 3.5774e-02];
%Algorithm starts
for k=1:K+1
for j=1:J
a(k,j);
for i=1:n
t(i+1)=t(i)+h;
phi(i+1)=(phi(i)+h*f(t(i+1)))./(1+h.*a(k,j));
end
Output= phi(end,:)
end
end
% This is the function file used in the above code. %% function ft=f(t)
ft=t;
end
The output is: How to get this output as a single matrix?

답변 (1개)

Sania Nizamani
Sania Nizamani 2018년 9월 6일
That doesn't work.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by