Risposto
how to convert python code to matlab
% import random % import statistics % shadow = [] % for i in range(20): % x = random.randint(1, 20) % shadow.append...

oltre 2 anni fa | 0

Risposto
How do I call a specific row in a table of data
% dummy data x = randn(7, 5) % In your data, 1st column is distance. You should ignore it for % averaging. xave = mean(x(:,...

oltre 2 anni fa | 0

| accettato

Risposto
Turning categories into double
x = categorical([1 1 2 4 4 7 7]) double(x) double(string(x))

oltre 2 anni fa | 0

Risposto
Separate values from one column
x = [26380 26381 26382 327207 327208 327209 327210 400 450 500]; threshold = 1000; xd = diff(x); idx = find(abs(xd...

oltre 2 anni fa | 0

| accettato

Risposto
how to remove the background from an image ?
There are many image segmentation techniques availble in image processing toolbox. Search "image segmentation" in documentation...

oltre 2 anni fa | 1

Risposto
How to Cite MATLAB File Exchange file using Bibtex?
You can do it manually as follows: [Updated] atharva aalok (2021). Professional_Plots (https://www.mathworks.com/matlabcentral...

oltre 2 anni fa | 0

| accettato

Risposto
How to create a customized meshgrid?
%71x9866 double" size meshgrid where my x axis will have the rang of 340 to 348 and my y axis will have the range of 66 to 74? ...

oltre 2 anni fa | 0

| accettato

Risposto
how to get an impulse response rather than a sine wave?
a = randn(10, 1); stem(a)

oltre 2 anni fa | 0

Risposto
How to extrapolate data with NaN data series?
magnetH = [21340; 21340; 21340; 21341; 21341; NaN; NaN; 21340; NaN; NaN]; % The original time_series statement are invalid tim...

oltre 2 anni fa | 0

| accettato

Risolto


The Piggy Bank Problem
Given a cylindrical piggy bank with radius g and height y, return the bank's volume. [ g is first input argument.] Bonus though...

quasi 3 anni fa

Risposto
How do I make numbers shift using a while loop while keeping the last itteration?
%x = input('Number of shifts to the left: '); x = 3; y=[8 4 -2 5 4 0 -1]; while x>0 y = MyShiftLeft(y) x = x-1; ...

quasi 3 anni fa | 0

Risposto
How to plot a curve between 2 data sets
Do you mean Dp vs Q? %% input data P1=[2.3;3.9;3.5;4.8;5.5;6.3;7.4]; P2=[4.8;5.7;6.5;7.8;9.2;10.5;11.8]; D=[78;65;57;52;46;3...

quasi 3 anni fa | 0

Risposto
Find Command not working.
use abs(difference) to comapare the float numbers. T=[NaN 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9]; a=0.6; V=find(abs(T-a)<1e-10)...

quasi 3 anni fa | 0

Risposto
For rows and 2 columns, containing xOy coordinates of the point. Look for the two points with the furthest distance and return the row index of those two points.
n = 8; xy = rand(n, 2); d = pdist(xy); D = squareform(d) [~, idx]= max(D(:)); [i, j] = ind2sub([n n], idx)

quasi 3 anni fa | 0

Risposto
I would like to create a handle function by for loop in matlab, but it does not work. I will be thankful if some body help me.
a=[1 2 3]; b=[4 5 6] n=length(a); for i=1:n s{i}=@(x) a(i)*x-b(i)*x; end s{1}(3)

quasi 3 anni fa | 1

Risposto
each columun of a 2D matrix multiply with a 3D array
A=rand(20,30); B=rand(6,6,20); c=0; for j=1:30 d=0; for k=1:20 d=d+A(k,j)*B(:,:,k); end c=c+d;...

quasi 3 anni fa | 0

Risposto
Feature Input layer error MATLAB 2021a
featureInputLayer is Introduced in R2020b. Try: which featureInputLayer numFeatures = 21; numClasses = 3; layers = [ ...

quasi 3 anni fa | 0

Risposto
Can I get help with loops and char function?
n = 3; %input('Enter # of derivatives to compute (1-7): '); %prompts a value input syms x E = 2*x^9 + 3*x^6 - 8*x^2 for i=1:n...

quasi 3 anni fa | 1

Risposto
Change char to cell
msg{1} =['abc12';'def34'] msgc = cellstr(msg{1})

quasi 3 anni fa | 0

Risposto
How can I add sinusoidal signal and fft?
fs = 1000; f = [40 80 100 250]; % freq a = [1 2 3 1]; % amp p = randn(1,4)*2*pi; % phase t = (0...

quasi 3 anni fa | 0

| accettato

Risposto
How to view image from .MAT file
x = load("1.mat"); x.cjdata figure(1); imagesc(x.cjdata.image); axis image saveas(gcf, 'a.jpg'); figure(2); imagesc(x.cjdata...

quasi 3 anni fa | 0

| accettato

Risposto
Can you exclude dates in date range using xlim?
dn = now + [0:.5:48]/24; y = randn(size(dn)); subplot(311) plot(dn, y) datetick('x') subplot(312) idx = hour(dn)>7 &...

quasi 3 anni fa | 0

| accettato

Risposto
Modulus Arithmetic Function Not Working
715^17 is too big. You can use symbolic computation: r=rem(sym(715)^17,2773)

quasi 3 anni fa | 0

| accettato

Risposto
Storage results in an array
% Without loop x=[2,3,4,5,6]; y=x; y(x>4)=x(x>4).^2; y(x<=4)=x(x<=4)+2 % With loop x = [2,3,4,5,6]; y = zeros(size(x)); ...

quasi 3 anni fa | 0

Risposto
programme matlab pour calculer et trace l'histogramme d'une image
I = imread('pout.tif'); imhist(I)

quasi 3 anni fa | 0

Risposto
Matrix Multiplication for each row
n = 5; %100000 A = randn(n, 2); B = [4 2; 2 3]; if n<100 d1 = diag(A*B*A') end d2 = sum(A.*(A*B'), 2)

quasi 3 anni fa | 0

| accettato

Risposto
Plotting pie charts over GraphPlot
Here is the updated answer. We play with the properties of pie_chart this time. clf s = [1 1 1 1 2 2 3 4 4 5 6]; t = [2 3 4 ...

quasi 3 anni fa | 1

| accettato

Risposto
How to change the position of labels on plot?
Add a number to z in "text" command. data = [1,0,3.8*10^8 2,1,4.2*10^7 3,2,1.5*10^7 4,3,7.8*10^7] ; x = data(:,1) ; y = ...

quasi 3 anni fa | 0

| accettato

Risposto
Plotting over a Range of Values
Use the array operator .* ./ .^2 for arrays. altitude = 150:1:1000; mu_earth = 3.986*10^5; %km3/s2 orbital_speed = sqrt(mu_ea...

quasi 3 anni fa | 0

| accettato

Risposto
Fitnet: Out of memory error solved by transposing?
When you use "my_ANN = train (net_set, input,output)", your network will have a input/output size of 49736, which results in man...

quasi 3 anni fa | 1

| accettato

Carica altro