Answered
plot3 bunch of particles
scatter3(S(:,1),S(:,2),S(:,3));

4 years ago | 1

| accepted

Answered
How to make a "page transpose" in a 3D matrix without using the function pagetranspose?
for k=1:size(yourMatrix,3) newMatrix(:,:,k)=yourMatrix(:,:,k)'; end

4 years ago | 1

Answered
make code more rigorous
Why have functions if you only call them once? L = 20 A = 230 dT =[100:1:120] a = 0.0039 rho1 = 0.0178 rho2 = 0.0170 a2 ...

4 years ago | 0

Answered
Calculate duration of Peaks using findpeaks function
f=num2str(Windspeed>=th); f=f(f~=' '); [startIndex,endIndex]=regexp(f,'1*'); Duration=diff(datenum([time(startIndex),time(end...

4 years ago | 0

Answered
What function to use to quantize a variable
Something like this. x=100*rand(1000,1)-50; h=linspace(-50,50,129);%for 128 resolution [~,~,bin]=histcounts(x,h); q=x(bin);

4 years ago | 1

Answered
How to check two conditions?
function output=even_or_odd() x = input('Insert a number: '); if mod(x,2)==0&&x>=0 output='Your input is positive and ev...

4 years ago | 1

| accepted

Answered
How can I uniformly disperse circles in an array?
[x,y]=meshgrid(1:21); scatter(x,y,5,'o','MarkerFaceColor','k','MarkerEdgeColor','k');%change marker size for different size cir...

4 years ago | 0

Answered
Generate 2d quadrilateral grid for a circle
https://www.mathworks.com/matlabcentral/fileexchange/57824-mesh-a-circle-with-quadrilaterals

4 years ago | 0

Answered
Using if-statements seperatly for each value in an array
numberOfMachines = 500; x = randi([0,1],numberOfMachines,1); y=zeros(size(x)); y(x==1)=10;

4 years ago | 0

| accepted

Answered
I need to use Newton's method to solve f(x). Can any one tell me what's wrong of my code and how to improve it.
a=1:4; tiny=1e-10; x=ones(size(a));%this will not work well for the initial guess for k=1:length(a) f=@(x)tan(x)+a(k)*sin(x...

4 years ago | 0

Answered
I need help, I try to find the code of the Gauss–Jacobi quadrature rule, if anyone have it please
Simple file exchange search: Gauss-Jacobi quadrature rule (n,a,b) - File Exchange - MATLAB Central (mathworks.com)

4 years ago | 0

| accepted

Answered
select column X values across rows based on meeting multiple conditions from column Y and Z in 3D matrix and then importing those values into a 2D matrix
An example would be helpful (or attach your matrix), but if I understand you. yourMatrix=randi(5,64,41,5);%example matrix newC...

4 years ago | 0

Answered
Is it possible to record the final value of each while loop?
play='y'; count=0; while isequal(play,'y') guess=0; count=count+1; rounds(count)=1; number=randi(100); while ~i...

4 years ago | 1

Answered
What is the fastest and smartest way to import and manage/plot many text files in matlab?
As long as you are in the folder you want, you just need the file name. for k=1:55 f=num2str(k); if length(f)==1 f=...

4 years ago | 1

Answered
How can I crop the image at a particular location each time?
Your rbg image is just a matrix. Just index into the matrix at the location you want. x=uint8(randi(255,1000,1000,3)); imshow(...

4 years ago | 0

Answered
Plot function only plots one coordinate
fprintf('Parabolic motion 1\n'); fprintf(1,'Provide an input for the following constants\n'); V0 = input('Initial velocity = '...

4 years ago | 0

Answered
Plotting multiple equations in one plot
L=.01:.01:1; count=1; for v=[.5 1] r(count,:)=(1-L)./(log(1./L)-v); count=count+1; end for n=[8 4] r(count,:)=n...

4 years ago | 0

| accepted

Answered
How can i re write the code in bold to be able to run it properly.
if K > H && phi==1 && eta==1 price = C +E; elseif K<=H && phi==1 && eta==1 price = A - B + D +E; elseif K > H && phi...

4 years ago | 0

| accepted

Answered
How to create all combinations of boolean vector possibilities?
x=1:2^5-1; m=logical(dec2bin(x',5)-'0');

4 years ago | 2

| accepted

Answered
Problem with generating random numbers from a 2D distribution
Why not something like this? I might not be understanding you. r=randi(10,1,2); f(theta(r(1)),phi(r(2)));

4 years ago | 0

Answered
Why can't Matlab do the factorial of a non-integer number?
Use the gamma function. gamma(1.3);

4 years ago | 0

Answered
How to convert each equation calculations into FOR Loop form
No loop needed. p = linspace(1.001,5); AdK2 = 1.4; Eff_Ratio = 1-(p.^AdK2-1)./(AdK2*(p-1))./((17:2:25).^(AdK2-1))'; plot(p,E...

4 years ago | 1

| accepted

Solved


Three...is a magic number.
Yes it is... It's a magic number... To help you get rid of that earworm, here's a new Cody problem. You are given a squar...

4 years ago

Solved


List the nth prime quartet prefix
Prime numbers larger than 5 can end only in 1, 3, 7, or 9, but of course not all numbers ending in these four digits are prime. ...

4 years ago

Solved


Play Outside In with primes

4 years ago

Solved


Determine whether a number is a prime self number
Integers can be classified as generated numbers or self numbers. A generated number is one that can be expressed as the sum of a...

4 years ago

Solved


List the dihedral primes

4 years ago

Answered
How to post a graph online
saveas(gcf,'myfigure.pdf') Then download from Matlab online to your computer.

4 years ago | 0

| accepted

Load more