changing values in matrix from static output to dynamic output
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
I have a model based on fitness and I'm trying to add some variability to the terminal fitness.
Previously I had this:
cap=15;
crit=3;
term=20;
Ft=zeros(cap,cap,cap,term);
x=linspace(1,cap,cap)';
%specify terminal fitness
Ft(x<=crit,:, :, term)=0;
Ft(x>crit,:,:,term)=1;
But I want to change it so that it's a gradient dependent on the size of x, i.e. an x=15 would be 1, an x=14 would be 0.93 etc.
I tried this:
%specify terminal fitness
Ft(x<=crit,:, :, term)=0;
Ft(x>crit,:,:,term)=x/cap;
but I keep getting this error:
Unable to perform assignment because the size of the left side is 15-by-18-by-18 and the size of the right side is 18-by-1.
What am I doing wrong here?
3 Comments
Kitt
on 21 Dec 2024
Moved: Star Strider
on 21 Dec 2024
so the setup of Ft is the "fitness" of an individual given (physical state, info1 state, info2 state, timestep) that ranges from 0 to 1
I have two equations Fdd and Fdbb that calculate a potential fitness and Ft holds whichever value is higher for every timestep except the last.
I want to specify what Ft based soley on physical state (x) for the last timestep (term)
I guess I'm confused why putting
Ft(x>crit,:,:,term)=1;
works but
Ft(x>crit,:,:,term)=x(x>crit)/cap;
doesn't?
Star Strider
on 21 Dec 2024
The matrices on both sides of the assignment have the have the same sizes. The error message is clear. The right-hand-size creates a (12x1) vector, while the left-hand-side remains a (12x15x15x20) matrix (the size changed by the logical reference).
(I removed my answer because it doesn’t solve the problem.)
Kitt
on 21 Dec 2024
Oooh Okay I understand, I'll have to find a workaround then. Thank you!
Accepted Answer
Star Strider
on 21 Dec 2024
Edited: Star Strider
on 21 Dec 2024
I don’t know if this does what you want, however it has the virtue of not throwing the size mismatch error —
cap=15;
crit=3;
term=20;
Ft=zeros(cap,cap,cap,term);
x=linspace(1,cap,cap)';
%specify terminal fitness
Ft(x<=crit,:, :, term)=0;
% Q0 = size(Ft)
% tmp = repmat(x(x>crit)/cap, 1, size(Ft,2), size(Ft,3));
% disp(tmp)
% Q1 = size(tmp)
Ft(x>crit,:,:,term)=repmat(x(x>crit)/cap, 1, size(Ft,2), size(Ft,3));
size(Ft)
ans = 1×4
15 15 15 20
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
disp(Ft(:,:,:,term))
(:,:,1) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,2) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,3) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,4) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,5) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,6) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,7) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,8) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,9) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,10) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,11) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,12) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,13) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,14) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
(:,:,15) =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667 0.2667
0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333 0.3333
0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000 0.4000
0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667 0.4667
0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333 0.5333
0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000 0.6000
0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667 0.6667
0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333 0.7333
0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000 0.8000
0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667 0.8667
0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333 0.9333
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
I left the ‘tmp’ matrix and its size result commented-out. Un-comment them to see what they produce.
EDIT — (21 Dec 2024 at 19:59)
Note that in your assignment, only the 20th ‘page’ of ‘Ft’ (corresponding to the value of ‘term’), is assigned.
.
2 Comments
Kitt
on 22 Dec 2024
this is exactly! Thank you so much and for telling me about repmat!
Star Strider
on 22 Dec 2024
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Tags
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)