Beantwortet
can anyone explain this result ?
:) >> expression= [1.0000 -1.6667 0.6667] expression = 1.0000 -1.6667 0.6667 >> expression*3 ans...

mehr als 8 Jahre vor | 0

Beantwortet
i am new to matlab please help solving this problem
May be so?: n=1:1:365; I=1.367; d=23.45*sin(360*(284+n(:))/365); t=[43.69 34.47 22.17 7.39 2.74 5.74 14.43 26.38 3...

mehr als 8 Jahre vor | 1

Beantwortet
Value of c and n might be unused ?
function [Nu] = nusselt(Re, Pr) c = [nan nan;0.989 0.330; 0.911 0.385; 0.683 0.466; 0.193 0.618; 0.0266 0.805; nan nan...

mehr als 8 Jahre vor | 1

Beantwortet
cumulative sum in a loop
Z = rand(10,1,10); Z_add = randi(5,2,10); out = cumsum([Z;Z_add]); with for - loop m = 5; Z = randi(2...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
How to Pad an Array with extra zeros
A=[1 8 1 9 1 4 1 5 0 4]; n = 4; B = reshape([A(:);zeros(mod(-numel(A),n),1)],n,[])';

mehr als 8 Jahre vor | 2

Beantwortet
How do I sum values of (x plus x-i) for (i=1 to x-1) using a while loop?
sum(1:userNum); % better practice of MATLAB and variant for your "dance": summedValue = 0; userNum = 5 while us...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Counting days by month
Here A - your array "100x11 char array with dates (e.g. '03-Jan-2006')" z = datetime(A); T = table(datetime(z,'F','MMM-uuu...

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Save sub-matrix column and row in another matrix
Let a - your array [Month Day Year Value] out = a(a(:,3) == input_year,:);

mehr als 8 Jahre vor | 1

Beantwortet
list the result of the index values in ranges
a = [1 1 2 2 3 3 3 2 2 1 1]; l = diff([0,a(:)'])~=0; b = [strfind(l,[1 0]);strfind([l,1],[0 1])]'; out = accumarr...

mehr als 8 Jahre vor | 0

Beantwortet
How to transform the entry in the vector in ascending and descending order after few points?
ii = find(X~=1)-1; Y = zeros(size(X)); Y(1:ii:numel(X)) = 1; out = X(ii + 1) + cumsum(Y) - 2; or ii = find(X~...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
How would I sum a function and use fzero?
f = @(T)sum(sin(t(:) - T)) fzero(f,.5)

mehr als 8 Jahre vor | 1

Beantwortet
Find double repetitions in a (sorted) array.
x= [2; 2; 5; 5; 5; 8; 8; 13; 13; 13; 13]; [~,~,g] = unique(x); % OR for last versions of MATLAB: g = findgroups(x) c...

mehr als 8 Jahre vor | 2

| akzeptiert

Gelöst


Relation between functions "dec2bin" & "dec2binvec"
Here it's an easy problem we try to find the relation between the two functions "dec2bin" & "dec2binvec", so here you must write...

mehr als 8 Jahre vor

Beantwortet
selecting values that are repeating most of the times in an array
[x,~,c] = unique(A); [~,ii] = sort(accumarray(c,1),'descend'); B = x(ii(1:4));

mehr als 8 Jahre vor | 0

| akzeptiert

Beantwortet
Creating vector from another vector containing 2x2 matrix indices
[~,ii] = min(A); V = B(sub2ind(size(A),ii,1:size(A,2)));

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
I have a 32 * 32 matrix .i want to take mean of each 4*4 so that the matrix is reduced to 8*8 array. Can anyone help me how to do that?
Try use <http://se.mathworks.com/help/images/ref/blockproc.html#br_lkwm-1 |blockproc|> from |Image Processing Toolbox| out...

mehr als 8 Jahre vor | 6

| akzeptiert

Beantwortet
search for a string in other file and return new files based on multiple condiion
n = dir('curva_pbc_uof_*.txt'); nn = {n.name}'; k = numel(nn); c = readtable('cond.txt','ReadVariableNames',false); ...

mehr als 8 Jahre vor | 2

| akzeptiert

Beantwortet
find repeating numbers
way with use |accumarray| a = 0; b = 100; data = randi([a b-a],1000,5); [unNum,n,n] = unique(data(:)); ...

mehr als 8 Jahre vor | 1

Beantwortet
Create variables for sub matrices from selected columns 0f a larger matrix
M = [1 2 3 4 5 ; 1 3 2 1 3]; b = unique(M(2,:)); n = numel(b); TD = cell(n,1); for ii = 1:n TD{ii} = M(:,M...

mehr als 8 Jahre vor | 0

Beantwortet
search for elements of a vector in a matrix (without using ismember)
all(ismember(A,b),2) or diff(A(all(ismember(A,b),2),:),1,2)~=0

mehr als 8 Jahre vor | 3

Beantwortet
How to plot a definite range of values in a for loop?
Let Y - your data (24 x 365); plot(Y(12:15,:))

mehr als 8 Jahre vor | 0

Beantwortet
find all the possible pairs with postive elements from a given matrix
t = A > 0; k = (1:size(A,1))'.*t; p = arrayfun(@(x)k(k(:,x) > 0,x),1:size(A,2),'un',0); jj = cellfun(@numel,p); ii...

mehr als 8 Jahre vor | 2

| akzeptiert

Beantwortet
Sort a matrix with another matrix
[~,ii] = sortrows([B,A(:,1)]) C = A(ii,:)

mehr als 8 Jahre vor | 0

Beantwortet
How to change values in a vector
c = readtable('20171015.txt','delimiter',':','ReadVariableNames',false) t = duration(c{:,:}) out = seconds(t);

mehr als 8 Jahre vor | 0

Beantwortet
How to find the intersection point of two vector arrays?
>> f{1} = griddedInterpolant(v1,P); f{2} = griddedInterpolant(v2,P); fzero(@(x)f{1}(x)-f{2}(x),[eps v1(end)]) ans = ...

mehr als 8 Jahre vor | 1

| akzeptiert

Beantwortet
What does " Subscript indices must either be real positive integers or logicals" mean and how do I fix it?
Maybe: sigmax=-2*v2*Pmax*(sqrt(1+(z.^2/b^2))-(z/b))

mehr als 8 Jahre vor | 1

Beantwortet
Combination of numbers with specific order
out = nchoosek(kron(4:2:14,ones(1,5)),5); or x = kron(4:2:14,ones(1,5)); out = hankel(x(1:end-4),x(end-4:end));

mehr als 8 Jahre vor | 2

| akzeptiert

Beantwortet
making random sparse matrix
Use <http://se.mathworks.com/help/matlab/ref/sprand.html |sprand|> or <http://se.mathworks.com/help/matlab/ref/sprandn.html |spr...

mehr als 8 Jahre vor | 1

| akzeptiert

Mehr laden