已回答
How do I change Array element with another array element?
A = [0 0 0 0]; B = [1 1 0 0]; A=B

2 years 前 | 0

已回答
fplot graph error getting y=0
There is a sinularity around -5.6e-4 (advoid this area) math=@(x)0.6.*x.^3.*exp(-0.4./x)+1.5.*x.^2.*exp(-0.6.*x); fplot(math,[...

2 years 前 | 0

| 已接受

已回答
Base-2 logarithmic scale on bar diagram
A logarithmic scale does not matter what the base is. You can change the markers to whatever you want (powers of two). figure; ...

2 years 前 | 0

| 已接受

已回答
The plot of cosine is not shown
xt will always be 1 and is plotting correctly. cos(2*pi*100*t) will always be an interger multiplied by 2*pi, and cos(2*pi)==1.

2 years 前 | 0

| 已接受

已回答
How to fit lognormal distribution on my data
Look at lognfit [pHat,pCI] = lognfit(repelem(vector1,vector2));

2 years 前 | 0

已回答
Triangle Circle Dataset Creation
Look at polyshape

2 years 前 | 0

已回答
How to compare two arrays of strings?
Use string arrays instead of character arrays. A=["red","purple","blue","green"]; B=["orange","purple","yellow","green"]; C=B...

2 years 前 | 0

| 已接受

已回答
problem with condtitions in program
Hard to understand what you are trying to do. Looks like you are good to about 72. t=[0.0840000000000000,0.935000000000000,1.83...

2 years 前 | 0

已回答
Hi there, does anyone know how to help me resolve this issue? My code keeps running on and on. If you can help me figure the issue please :)? And also the plots are not showin
You are getting stuck in your positionfourbar() while loop. You need to evaluation your equations and comparison to epsilon.

2 years 前 | 0

已回答
Get MatLAB to read data instead of text
Try readtable t=readtable('yourFile.csv');

2 years 前 | 0

已回答
Add Letters in a sequence
l='abcdefghijklmnopqrstuvwxyz'; gap='defjklmrstuvwz'-96; l(gap)='-'

2 years 前 | 1

| 已接受

已回答
Why does my else doesnt work?
a = [-3.821; 0.135; 5.995; -5.557; -4.041; -3.094; -3.244; -3.074; -1.241; -4.216; -2.834; -0.424; 5.337; -0.088; 2.985; 4.136;...

2 years 前 | 1

| 已接受

已回答
'MarkerFaceColor' according to y value
x = linspace(0,3*pi,200); y = cos(x) + rand(1,200); sz = 25; c = y/max(y)*10; scatter(x,y,sz,c,'filled') hold on; plot(x,y...

2 years 前 | 0

已回答
Difference between x = 0:0.1:2*pi and linspace(0,2*pi,0.1)
Linspace divides the interval into the exact number specified, while colon notation just keeps increasing the interval by the mi...

2 years 前 | 1

| 已接受

已回答
zeros populating most of my output vector
You will start running into problems with higher no_of_calls because the no_of_channels will increase and factorial numbers will...

2 years 前 | 1

| 已接受

已回答
Generate random numbers with truncated Pareto distribution
Just write a simple function function x = ranPareto_trunc(H,L,alpha,n)%H=upper, L=lower, alpha>0, n=number of random numbers de...

2 years 前 | 0

已回答
is it possible to make this code shorter?
r=x/2.*cos(cumsum(rad)); R=[r(1),2*cumsum(r(1:6))+r(2:7)]; mg=flip(cumsum(flip(Fz.*R))); c=-mg./rad;

2 years 前 | 0

已回答
Randomize a marker color for a graph
m='o+*.x'; c='rgbcmyk'; x=randi(20,1,8); y=randi(20,1,8); figure;hold on; for n=1:length(x) scatter(x(n),y(n),'LineWidth...

2 years 前 | 0

已回答
why is this code not working?
Function works fine. f=@(x)x.^2.*sin(x)-x.*cos(x)+3;%sample function df=@(x)x.^2.*cos(x)+3*x.*sin(x)-cos(x); [root,iter,v]=ne...

2 years 前 | 1

| 已接受

已回答
How to create a polar plot?
load S x = real(S); y = imag(S); rho = sqrt(x.^2+y.^2); theta = atan2(y,x);%use atan2 (4 quadrant) polarscatter(theta, rho,...

2 years 前 | 0

| 已接受

已回答
custom distance with the kmeans
data=randi(100,10,2); centroid1=randi(100,1,2); centroid2=randi(100,1,2); m=sum(abs((data-centroid1)./std(data(:,1))),2); n=...

2 years 前 | 0

已回答
How to keep false as false, and not as zero
If you are just using false as a flag, change false into some other number flag. You could use a particular number that will nev...

2 years 前 | 1

| 已接受

已回答
how to get the same result using rand
s=sum(rand(2,1e6)-.5); histogram(s,40)

2 years 前 | 1

已回答
Grouping consectuve datapoints from a table into an array
Best to keep all the data together. Just reshape the array and index into it. pulse=reshape(yourTable.InstantPowerX,3,[])';%pul...

2 years 前 | 0

已回答
Plotting a scaler and adding a legend to graph
Look at legend to add an appropriate legend. % in m/s v= 0:1:261; AirDen= 1.225; CdA=0.501; coefficient =0.006; g=9.81; m...

2 years 前 | 0

已回答
How to dynamically name a large number of tall tables?
This should read all tables one at a time, combine the same categorical names, and store new tables as the categorical names. d...

2 years 前 | 0

| 已接受

已回答
Efficient way to reshape data
data = [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...

2 years 前 | 0

| 已接受

已回答
Angle between two 3D vectors
I don't see anything wrong. I assume you are using a loop. st_direction =[0.6320;0.7308;0.2579]; A =[-0.8903 -0.6071 -0.7...

2 years 前 | 1

| 已接受

已回答
How to solve a function with uknown parameter with bisection method
x=13.61015;y=13257; f=@(p)(x^3+p.^(2*x^2)-10)*sin(x)-y; p=fzero(f,1) P=1.01:.00001:1.03; plot(P,f(P))%plot shows zero crossi...

2 years 前 | 0

已回答
Coding and ploting of a serie
t= 0:0.001:1; n=1:5; a=[0.05282 -0.00909 -0.02733 0.02509 -0.00268]; b=[-0.04866 -0.0104 0.002598 0.02111 -0.01372]; w=8.48...

2 years 前 | 0

| 已接受

加载更多