Clear Filters
Clear Filters

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 view (last 30 days)
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?

Answers (1)

Sania Nizamani
Sania Nizamani on 6 Sep 2018
That doesn't work.

Categories

Find more on Programming in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!