Community Profile

photo

Kai Jensen


Active since 2018

Followers: 0   Following: 0

Statistics

  • Thankful Level 1

View badges

Feeds

View by

Question


How can I make this code more efficient?
close; clear all; clc; global cp1 vp1 cp2 vp2 value gk; A=1; % aggregate productivity a=0.36; % capital share of output (...

5 years ago | 0 answers | 0

0

answers

Question


How to vectorize these nested for loops
for i=1:knum for j=1:knum cp1(i,j)=max(pf(kgrid(i))+(1-depreciation)*kgrid(i)-kgrid(j),0); vp1(i,j)= log(cp1(i...

5 years ago | 0 answers | 0

0

answers

Question


Any way to make this code take up even less lines?
clear; close all; clc; iif = @(varargin) varargin{2 * find([varargin{1:2:end}], 1, 'first')}(); d = @(x)mod(x,2); e = @(x...

5 years ago | 1 answer | 0

1

answer

Question


How to make MATLAB code run faster
How do I speed this script up? nuke; h = 16; %hours available K = 15; %Capital z = 1; %Total factor productivity t = 0; ...

5 years ago | 1 answer | 0

1

answer