Risposto
How can i make this chart?
t = 0:0.1:5; x = cos(2*pi*t).*exp(-t); plot(t, x); xlabel('t'); ylabel('x(t)');

quasi 3 anni fa | 1

| accettato

Risposto
Input a vector whose number of elements is NaN. Let's replace the NaN elements in the vector with the previous value.
A = [1 3 NaN 4 NaN NaN 5]; F = fillmissing(A,'previous')

quasi 3 anni fa | 0

Risposto
Compare strings and print to the screen
The code works: A='thisisastr'; B='anotherstr'; C='anothernot'; aA='anothernot'; bB='thisisastr'; cC='anotherstr'; QQ='someth...

quasi 3 anni fa | 1

| accettato

Risposto
How make this curve bit smooth or how to reduce some spikes?
Try the median filter, where X is your data, N could be around 10 (try it out). Y = medfilt1(X,N)

quasi 3 anni fa | 1

Risposto
Index exceeds the number of array elements (3).
What is the purpose of your code? n = 4; %input('What"s your ""favorite"" number? ') twiceYourFavoritePlusOne = 2*n + 1 myFav...

quasi 3 anni fa | 0

Risposto
Load txt file and split into the matrix
B = {'-9.4925,78.2355,49.0974,-0.5710247,0.7637159,0.3011125' '-10.1414,78.2525,48.7282,-0.5694185,0.7634438,0.3048215...

quasi 3 anni fa | 0

Risposto
how to plot a figure with a title in Arabic?
Matlab support unicodes: plot(rand(6,1)); title("بﺖ"); % random arabic charactors xlabel("بﺖ"); ylabel("بﺖ");

quasi 3 anni fa | 0

Risposto
Unrecognized function or variable 'importONNXFunction'.
try "which importONNXFunction" to see if it is installed. (It could be a supported package you have not installed).

quasi 3 anni fa | 0

Risposto
Hello, I have problem with my s-function
Try the following: xdot = [x1dot x2dot x3dot x4dot x5dot x6dot]';

quasi 3 anni fa | 0

| accettato

Risposto
How to rise the resolution of a map in MATLAB using geoshow?
You can try to obtain higher resolution geo data (finer grid and more data points). Sometimes, interpolation of the coarse dat...

quasi 3 anni fa | 0

Risposto
How to eliminate a column from a matrix?
C=[ 0.2474 -0.0311 0 0 0 0.5000 ]; C(:, end) = []; % remove last column C

quasi 3 anni fa | 0

| accettato

Risposto
I don't know how to avoid eval
N = 2, M = 2; %p = [0,0; 1,0; 0,1; 2,0; 0,2; 1,1]; p = subIndex(M,N) p = subIndex1(M,N) function p = subIndex(M,N) s = ...

quasi 3 anni fa | 1

Risposto
Need To Find Value of Y at X for Curve Z. Detail Problem Explained in description
Without knowing your data, the following code only gives you an idea: z0 = [5 6 7 8 9 10 12 14 16 18 20 25 30 35 40 50 60 70 80...

quasi 3 anni fa | 0

| accettato

Risposto
How can I call a previous user inputted variable to a string array?
Mind the difference between string and char: newMaterial = string(input('Please enter a new material name:','s')) ;% Copper M...

quasi 3 anni fa | 0

| accettato

Risposto
2 variable surface plot with isoline
[x, y] = meshgrid(0:.1:6, 0:.1:6); z = sin(x).^2 -0.2*x.*y; s = surfl(x, y, z); s.EdgeColor = 'none'; view(-120, 30) hold...

quasi 3 anni fa | 0

| accettato

Risposto
Make arrays into a table
It's better to organize the table in transposed order. a1 = rand(10, 1); a2 = rand(10, 1); a3 = rand(10, 1); T = table(a1, a...

quasi 3 anni fa | 0

Risposto
If Else Statement in For Loop
n1 = 6; % 1440 n2 = 4; % 721 n3 = 2; % 40 mag_strength = randn(n1, n1, n3) Fronts = mag_strength; Fronts(Fronts<=1) = n...

quasi 3 anni fa | 0

| accettato

Risposto
How do I find all the numbers between [0 1.5] in a 10x2 matrix?
a = randn(10, 2)*2 a1 = a(a>=0 & a<=1.5)

quasi 3 anni fa | 1

Risposto
compute the convolution and plot the sequence
x=[1 2 3 4 5 6]; y=[1, 1 ,1] z = conv(x, y); stem(z)

quasi 3 anni fa | 0

Risposto
convert for loop's answers into a vector
The following is not really a conversion and more a correction; aR2=rand(1,30); maR2= mean(aR2)

quasi 3 anni fa | 0

Risposto
Angle or heading of a line relative to north from Lat/Long
doc azimuth, distance for more details: lat1 = 10; lon1 = 10; lat2 = 10; lon2 = 20; az = azimuth('rh', lat1, lon1, lat2, lon2...

quasi 3 anni fa | 0

| accettato

Risposto
Finding an index in a structure with a 'char' field
You can try the following or you post your data. idx = strcmp({s.y}, 'ATC'); s(idx)

quasi 3 anni fa | 0

| accettato

Risposto
How to average first two dimension of 3D array/matrix?
a = randi(3, 3, 4, 2) c = mean(reshape(a, [], size(a,3)))

quasi 3 anni fa | 1

| accettato

Risposto
creating a 5046x1 { } cell with specific category names
% Use array (instead of cell) a = ones(4,1) + (0:2); % change 4 to 1682 for your data ca = categorical(a(:), [1 2 3...

quasi 3 anni fa | 1

| accettato

Risposto
How to convert time column to from HH:MM:SS to minutes and seconds?
% table=readtable('sample.csv'): A=readtable('sample.csv') % table is a function name in matlab class(A.Time) % A....

quasi 3 anni fa | 0

| accettato

Risposto
oversampling an array randomly
a = randn(300, 1); % original data idx = randperm(300, 172); % randomly pick 172 from 300 a1 = [a; a(idx)]; whos

quasi 3 anni fa | 0

| accettato

Risposto
Matlab code for sine wave with varying frequency
clc; fs = 2000; %sampling frequency dt = 1/fs; %seconds per sample StopTime = 10; %seconds t = (0:dt:StopTime); F = 50.*t; ...

quasi 3 anni fa | 0

| accettato

Risposto
creating an interval from vector array
V = [1 2 3 4 5 6 7 8 9 10]'; i = 4; % interval 4 interval = V(i:i+1)'

quasi 3 anni fa | 0

| accettato

Risposto
Matlab command line output
It means the scale factor for the following numbers. You can consider * as multiplication. For example. a = randn(1,4)*1e6 ...

quasi 3 anni fa | 1

| accettato

Risposto
Error using log Not enough input arguments. This is the error message I keep getting. Pls help
Don't confuse the function handle with numerical variables. h = linspace(-500, 14439, 1000); p = @(h) 29.92 * (1 - 6.8753 * 10...

quasi 3 anni fa | 0

Carica altro