Answered
How can I find the max value from many max values inside the " WHILE LOOP " ?
GlobalMax=-9999; while true for %calculations end if maxpower>GlobalMax GlobalMax=maxpower; ...

4 years ago | 0

| accepted

Answered
using a for loop to find the mean of a set of data
T=randi(100,84,1); m=mean(reshape(T,7,[]),2);

4 years ago | 0

Answered
Why is this line so inefficient
tic; rho=rand(500000,1);n=9;m=3; s=0:(n-m)/2; numerator = (-1).^s .* factorial(n-s); denominator = factorial(s).*factorial((...

4 years ago | 0

Answered
If statement with two possible outcomes
if SoC(j)>=5 SoC(j)=0; Battprof(j)=-5; end

4 years ago | 0

Answered
Generate Random Number, that is that is repeatable
Use randi randi(1e9,1)

4 years ago | 0

Answered
I'm new to MATLAB and I want to consider a 4x4 pixel block with it's intensities from a whole picture which is a grey scale image. How do I do it?
a = imread('Spiderman.png'); y = rgb2gray(a); pixel_values=y(186:189,165:168);

4 years ago | 0

| accepted

Answered
Function is not running. please help me.
Works. Just copy and paste singletradecal into your function or run the script inside the function. function [NETPL, CHARGES, S...

4 years ago | 0

| accepted

Answered
Understanding the conditional output beginning with (t == 0 | v == 0)
logical (t==0 or v==0) t=randi(5,1,20)-1 v=randi(5,1,20)-1 idx=(t==0|v==0)

4 years ago | 0

| accepted

Answered
Maximal values of polynomial in Matlab
p=[2 5]; q=[1 0 1 2 2]; x=-1:.0001:1; J=@(x)polyval(p,x).^2./polyval(q,x); [~,idx]=min(abs(diff(J(x)))); Xmax=x(idx); Jmax...

4 years ago | 0

Answered
Add element inside cell with combination
[a,b,c]=meshgrid(A{2},A{3},A{4}); s=sum([a(:),b(:),c(:)],2);

4 years ago | 1

Solved


Find S-parameters of the circuit
Refer to <http://en.wikipedia.org/wiki/Scattering_parameters> for the information about the system of scattering parameters. ...

4 years ago

Solved


Image Processing 2.1.1 Planck Integral
Integrate the Planck function in Lambda (um) at T (K) accurately and quickly to find Radiance for a Lambertian source. Planck...

4 years ago

Answered
n E Z => sin(n*pi) = -1 ?
Use symbolics. function [out] = isInt(n) n=sym(n); out=double(sin(n*pi)); end Call function o=isInt('100000000000000000...

4 years ago | 0

Answered
Using switch to identify even or dd
Look at the function switch, case, otherwise, it does not work as you coded. function [y] = even_odd(x) r = mod(x,2); if x<=4...

4 years ago | 0

Answered
Take average of 1000 to be 100 values
r=mean(reshape(yourData,10,[]));

4 years ago | 0

Answered
How to calculate the curvatue of the surface?
https://www.mathworks.com/matlabcentral/fileexchange/11168-surface-curvature#:~:text=%5BK%2CH%2CP1%2C,to%20the%20surface%20being...

4 years ago | 0

| accepted

Answered
How to apply for loop?
for k=1:3 X(:,k)=X(:,k)+%whatever you are doing to the column end

4 years ago | 0

Answered
Replace values in a array
Attaching the data would help. range(ismember(range,y_max(y_max~=0)))=RMC(RMC~=0);

4 years ago | 0

Answered
loop for removing highest value until specific value is reached
[b,idx]=sort(A(:)); IDX=idx(cumsum(b)>=20);%linear index of each of the removed element's position

4 years ago | 1

Solved


Determine whether one vector is a subset of another
While bumbling through a pair of problems in the Number Theory group, I wrote code to determine whether a vector is a subset of ...

4 years ago

Solved


Ridge regularized linear regression
Given a predictor data matrix of size , target variable vector of size and a shrinkage factor (scalar) (ridge regularization...

4 years ago

Solved


Scorer's Function
Evaluate the Scorer's function for a given input. The expected output is Gi(x). Note - The precision will vary for test cases...

4 years ago

Solved


Sequence
Let S be a sequence of numbers Let Find for some , where and .

4 years ago

Solved


Momentum Calculation
A shopping cart of mass 'm1' is traveling with velocity 'u' and collides with a second shopping cart of mass 'm2.' The two shopp...

4 years ago

Solved


Calculate Percentage
Given marks obtained and total marks, calculate the percentage.

4 years ago

Solved


Aerodynamic load on a vehicle
Determine the aerodynamic load on a vehicle having aerodynamic drag coefficient , frontal area , moving at speed in an environm...

4 years ago

Solved


Find all prime factors of the input
Given an input x, find its all prime factors. Return the vector with all factors in ascending order. Efficiency is the key here...

4 years ago

Solved


B-Zuckerman Numbers
Similar to my last problem (B_Harshad Numbers), B-Zuckerman Numbers are numbers that are divisable by the product of their digit...

4 years ago

Solved


Find distance travelled by an object starting from rest in time 't' and linear acceleration 'a' = 3t
Find distance travelled by an object starting from rest in time 't' with linear acceleration a = 3t. You are given time t as an ...

4 years ago

Solved


Draw 'W'
For any given n, return a matrix of height n and width 4n-3 containing a W of ones. Example: n=2 ans= [1 0 1 0 1 0 1 0 1 0...

4 years ago

Load more