Answered
how to load and calculate data from a file?
variant Is=1E-9; k = 1.38*10^(-23); q = 1.602*10^(-19); T = 300; VT = k*T/q; m = 1.5; x=cell2mat(textscan(fopen('...

15 years ago | 0

Answered
Generating array of data using for-end looping
all without logspace [jj,ll] = meshgrid(1:20,1:5); result2 = reshape(10.^((jj-1)/2).*(1+ll/5*sqrt(10)),1,[]); or res...

15 years ago | 0

Answered
Array manipulation?
fd1 = find(isnan(PPP)) PPP(fd1) = 0; a = unique([fd1;fd1-1]) p = PPP(a); PPP(a)=cell2mat(cellfun(@(x)cumsum(x),m...

15 years ago | 0

Answered
add string to matrix/ array in loop
can so ... paths = cell(numel(filenames),1); for k=3:numel(filenames) [pathstr, name, ext] = fileparts(file...

15 years ago | 1

Answered
Make Mupad use trig identities to simplify integrations
variant syms x A B C int(subs(sinh(A*x)*sin(B*x)*cos(C*x),sinh(A*x),1/2*(exp(A*x)-exp(-A*x))),x) or so eval(['f1 = @(x,...

15 years ago | 1

Answered
Arraywise operators in Symbolic expressions
variant syms x y z F = vectorize(x^2+y^3-1/z); or syms x y z F = x.^2+y.^3-1./z; F = vectorize(F);

15 years ago | 0

| accepted

Answered
Storing values in a matrix from 2 for loops
variant P=100; E=1.5*10^6; b=3.375; d=1.5; I=(1/12)*b*d^3; L=20; a=10; x1=0:.2:a; x2=a+.2:.2:L; f=@(X,Y,Z)((-P*...

15 years ago | 0

Answered
Efficient way to split a vector into Matrix
variant D0 = buffer(B,5,4); D = D0(2:end-1,4:end)

15 years ago | 1

Answered
Letters in Matrix
You want this solution? C = cell(16); k = 1:3; C(k,2) = {'-B/H'}; C(k+4,2) = {'B/H'}; C'

15 years ago | 0

| accepted

Answered
Find first 1 of the first sting of 1s who's length exceed the length of every subsequent string of 0s
use ideas of Walter Roberson and Matt Fig v = v(:)'; ne = diff(find(diff([~v(1) v(:)' ~v(end)]))); % Walter Roberson I = ...

15 years ago | 0

Answered
Converting cells to strings
variant dc = struct2cell(data); t1 = cell2mat(cellfun(@(x)[ischar(x) isnumeric(x)],dc,'UniformOutput', false)); celst...

15 years ago | 0

| accepted

Answered
Need help with FOR loop with 3 indexes
is the same, without loop [k2,i2,j2] = meshgrid(0:10:100); s2 = [i2(:) j2(:) k2(:)]; a2 = s2(sum(s2,2)==100,:);

15 years ago | 3

Answered
One-dimensional array of variable length
better use of cell array strcll = []; for j = ... ... result(j) ... strcll = [ strcll; {result(...

15 years ago | 0

Answered
Lookup Table the floor value
added variant A = randi(120,5,5) n = 9 [~,I] = min(abs(A(:)-n)); A(I)

15 years ago | 0

Answered
sequence grouping
variant without loop a = 1:15; c = [6 9]; li=length(c); lii = -li:li; [non,I]=ismember(c,a); C = bsxfun(@(x,y)x+...

15 years ago | 0

Answered
Matrix manipulation
variant i = [785 58 595 389 450 956]; j = [4 6 2 3 5 1]; A(sub2ind(size(A), i, j)=1;

15 years ago | 2

| accepted

Answered
How to make a symbolic matrix?
variant: >>n=8;t=[];for j=1:n, t = [t;sym(['t' num2str(j)])]; end phi=@(k,omega)[ones(length(k(:)),1) k k.^2 sin(omega*k...

15 years ago | 1

Answered
I need to write a function which prints out prime number between the two arguments.
variant for *Faras Momin*: function [Prime] = PrimeNum3(N,M) if (N>M || N <0 || M < 0) error('ERROR: Invalid I...

15 years ago | 0

| accepted

Answered
I need to write a function which prints out prime number between the two arguments.
_Excuse for my English. Haste without checking the work of construction:_ for i = 2: ((N + j) / 2) if mod ((N + j), i)...

15 years ago | 0

Answered
I need to write a function which prints out prime number between the two arguments.
function Prime = PrimeNum (N,M) if (N>M || N <0 || M < 0) error('ERROR: Invalid Input, you entered biggere numbe...

15 years ago | 0

Answered
replace numbers of margins of metrix( how t0 fix it ?)
im([true(1,n);repmat([true false(1,n-2) true],m-2,1);true(1,n)])=3

15 years ago | 0

Answered
replace numbers of margins of metrix( how t0 fix it ?)
[m,n]=size(im);for ii = 1:m,for jj = 1:n,if ii == 1 | ii == m | jj == 1 | jj == n, im(ii,jj) = 3; end;end;end

15 years ago | 1