Answered
Initial Population in GA
I leave you a hypothetical example: availablespipediameter=[0.365 0.406 0.437 0.5 0.562 0.593 0.687 0.8 0.9:0.1:1.4];%put your...

6 years ago | 0

| accepted

Answered
Read matriz from text file
solution: data=table2array(readtable('yourfilename.txt'))

6 years ago | 0

| accepted

Answered
How do you graph this function?
solution: n=10; x=10:n:60; y=(x+(x-n))*1/2; figure; plot(x,y,'r*-')

6 years ago | 0

| accepted

Answered
dy/dx = sqrt(x-y) ; y(2) = 2
syms y(x) solution=dsolve(diff(y,x) == sqrt(x-y),y(2)==2)

6 years ago | 0

Answered
I want to play music in my Matlab game, how can I play one?
yes, you can do it, try it : load handel sound(y,Fs) you can play a file using the following command : [y,Fs] = audioread('n...

6 years ago | 1

| accepted

Answered
return the row and column of values in a matrix as a single row vector stored in a separate matrix
solution: m=tril(dist); m(m==0)=nan; [x,y]=find(m<12); returnn=[x,y]

6 years ago | 0

| accepted

Answered
anyway to call matlab function without bracket
yes it is possible, but you cannot assign the result to a variable, I leave you an example: function c=sumexample(a,b) if isc...

6 years ago | 0

| accepted

Answered
How to store text printed to console?
solution: [status,result]=system('WMIC CPU Get NumberOfLogicalProcessors'); number = str2double(regexp(result, '\d+', 'match'...

6 years ago | 0

| accepted

Answered
Deleting columns corresponding to time value
solution: data(:,t<3)=[]; disp(data)

6 years ago | 1

| accepted

Answered
how can i separate real numbers?
solution: A=[11.3 , 10+5i , 32 , 50+48i , 9 , 21+15i ,16 ] onlyreals=A(imag(A)==0) edit: with cell array A={ [ 1, 2+3i...

6 years ago | 1

Answered
Find geometric mean and arithmetic mean
I = imread('pout.tif'); a=imhist(I); arithmeticmean=mean(a); geometricmean=geomean(a);

6 years ago | 1

| accepted

Answered
Output is giving me "Empty sym: 0-by-1"
solution: syms s g = (s^2-2*s+2)/((s+2)*(s+4)*(s+5)*(s+6)) x = diff(g) b = double(solve(x))

6 years ago | 1

Answered
Use a matrix instead of a for loop
solution: N = 100; x = 1:N; p = 6; xx=repmat(x,p+1,1); sum_x=diag(fliplr(triu(fliplr(xx)))*rot90(triu(fliplr(xx+(0:p)'))))...

6 years ago | 0

Answered
logspace equivalent and sin(x) [solved]
a=1; b=3; c=3; logspace(a, b, c)==10.^(1:(b-a)/(c-1):b) %are equivalent on the other hand x=1:1000; A=sin(x); total=su...

6 years ago | 1

Answered
find max value in a Matrix using loops only
solution: X=[1,2,3;7,1,9;4,9,6;9,8,7]; Max = -Inf; row = []; column = []; for i=1:size(X,1) for j=1:size(X,2) ...

6 years ago | 1

| accepted

Answered
How to define different color for all three plots?
solution: omega = 1; alpha = 1;beta=1; f=@(ts,theta)[omega + alpha*(sin((theta(2)-theta(1)))); omega + alpha*(sin(theta(1...

6 years ago | 0

| accepted

Answered
How do I evaluate this integral?
solution: height1 =@(x,y) 2000.*1./exp((1.1.*sqrt((x-1).^2+(y-3.5).^2)).^2) + 2000.*1./exp((2.*(sqrt((x-4.5).^2+(y-1.5).^2)))....

6 years ago | 0

Answered
How do I use regexp to extract text between numbers
str = "↵↵↵1. Receptacles, general purpose. ↵2. Receptacles with integral GFCI. ↵3. USB Charger receptacles. ↵4. AFCI receptacles...

6 years ago | 1

Answered
Data Selection/Sorting
I hope this is what you are looking for: data=[23 20 18 50 17 24 56 35 38 19 29 53 26]'; f=sort(data,'descend'); f2=reshape(...

6 years ago | 0

| accepted

Answered
How can i make a partition matrix
If you are not interested in decimals, just add one, the solution is easy: c=5; k=3; matrixTemp=rand(c,k); matrixTemp=matri...

6 years ago | 1

| accepted

Answered
Line, column, and value in matrix B of repeated values ​​in A.
solution : [row,col]=find(ismember(B,A))

6 years ago | 0

| accepted

Answered
I'm trying to ad a condition to an equation
a trick: fx=@(x) (x~=0)*sin(x)^2/(x+(x==0))

6 years ago | 0

Answered
REPLACE ELEMENTS OF A MATRIX
the same way : matrixA=[0 1;0 1]; s=matrixA==0; if0=[1 0;1 0]; if1=[0 1;0 1]; R=num2cell(matrixA); R(s)={if0}; R(not(s))...

6 years ago | 0

Answered
replace elements of a matrix with another matrix
solution : A = randi (100 , 16 , 16) ; s=A>50; a=[5 5;5 5]; b=[20 20;20 20 ]; R=num2cell(A); R(s)={a}; R(not(s))={b}; R=...

6 years ago | 0

| accepted

Answered
Substract Matrix coloum-wise from Matrix without using a loop
if you have Statistics and Machine Learning Toolbox : distance=min(pdist2(A,B));

6 years ago | 0

Answered
make a matrix from
x=repmat(2,3,3) y=repmat(4,1,10)

6 years ago | 0

Answered
What is the difference between "while" and "for" in this program?
correction and solution: you should specify that the for goes in the opposite direction for i=n-1:-1:1 x(i)=(Ab(i,nb)-Ab(...

6 years ago | 0

| accepted

Answered
Creating a loop with for loop
solution: function [determinant , inverse ] = invanddet3by3(A) D=zeros(3); s=[2 3; 1 3; 1 2]; for k=1:size(D,1) for j=...

6 years ago | 0

| accepted

Answered
Select values from 20 x 15 matrix based on a row vector 1 x 15
solution: A(A>=B)=nan; disp(A) c=num2cell(A,1); for k=1:size(c,2) c{k}(isnan(c{k}))=[]; disp(['Column ' num2str(k...

6 years ago | 0

| accepted

Answered
edge detection in image processing
solution : I=rgb2gray(imread('coins1.jpg')); imshow(I) bw1=edge(I,'sobel'); figure imshow(bw1)

6 years ago | 1

| accepted

Load more