Risposto
Inserting doubles into the field of a struct
load(websave("Updating.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1129165/Updating.mat")) load(websa...

quasi 2 anni fa | 1

| accettato

Risposto
Amplitude Spectrum of a function
If you are studying the effect of sampling frequency, you may want to fix the signal duration, for example . In this case, you ...

quasi 2 anni fa | 0

Risposto
How do I plot a Bayesian network graph in my way?
DAG = [0 0 1 0 1 1 0; 0 0 1 1 0 0 1; 0 0 0 1 1 0 0 ; 0 0 0 0 0 1 0; 0 0 0 0 0 1 0; 0 0 0 0 0 0 0 ; 0 0 0 0 1 1 0], %assume th...

quasi 2 anni fa | 1

| accettato

Risposto
How do I get Os at drag=0 and Xs for drag=1 on my plot? (code and plot in the description) (plot markers)
hold on idx = drag==1; plot3(h(idx), s(idx), drag(idx), 'r^') plot3(h(~idx), s(~idx), drag(~idx), 'bo')

quasi 2 anni fa | 0

Risposto
vectorized code is more time consuming than a simple for loop
With the improvement of the execution engine and jit, newer verions of matlab improve the for-loop performance. Very often, the...

quasi 2 anni fa | 0

Risposto
Hello everyone. I have a file .data and I need to convert it to an array. How can this be done?
websave("iris.dat", "https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data") x = readtable("iris.dat")

quasi 2 anni fa | 1

Risposto
Opening multi txt file with chosen directory location
mkdir TestDir % This is for demonstration only. websave("TestDir/10001.txt", "https://www.mathworks.com/matlabcentral/answers/...

quasi 2 anni fa | 0

| accettato

Risposto
How to correctly plot the PSD of segments of a signal?
% r1 = r(1:U); U = 8192; r1 = randn(U, 1) + 1i*randn(U,1); % complex baseband signal fs = 10000; fc = 2000; nfft = 1024...

quasi 2 anni fa | 0

Risposto
How to turn a dataset into a matrix
doc readmatrix doc readtable

quasi 2 anni fa | 0

Risposto
using a variable to call another variable
T1 = zeros(k, 1); % use array instead of T1_, T1_2, ... omega1 = zeros(k, 1); for n = 1:k temp = readmatrix(...

quasi 2 anni fa | 0

| accettato

Risposto
How can I close the currently open directory in matlab
% You change directory rather than close directory % We make two directories here for example mkdir dir1/dir1_1 mkdir dir2 ...

quasi 2 anni fa | 0

Risposto
How can I resize a mat file that contains images
V =rand(40, 40, 40); q = (0:59)/59*39+1; qqq = meshgrid(q, q, q); % 3d interpolation V1 = interp3(V, qqq, qqq, qqq); whos ...

quasi 2 anni fa | 0

Risposto
Read csv with quotes and numbers
type data.txt fid=fopen("data.txt", "r") a=fscanf(fid, '%d,"%d,%d,%c"', [4 inf])' fclose(fid)

quasi 2 anni fa | 1

| accettato

Risposto
MacLaurin Series Demonstration - Unexpected Result?
There was error in computing Y, which has been corrected. You should use loops/array operation instead of hard coding When X i...

quasi 2 anni fa | 0

| accettato

Risposto
Decimate every row in a matrix
% assume that decimate is used for downsampling a = randn(100, 26); % time is along the column [ns, nch] = size(a); r...

quasi 2 anni fa | 0

Risposto
Plot specific cells of cell array
A{1,1}=[]; A{1,2}=[]; A{2,1}=rand(1, 30); A{2,2}=rand(1,30); A{3,1}=[]; A{3,2}=[]; for i=1:numel(A) if ~isempty(A{i})...

quasi 2 anni fa | 0

| accettato

Risposto
Access variables with naming in workspace
First of all, try to change the program that produces data1 to data100 by using multidimensional array or cell array if possible...

quasi 2 anni fa | 0

Risposto
Number generator for 0.00006 to 30 range
% Kd=unifrnd(0.000069,30); logminmax = log10([0.000069,30]); for i=1:20 kdlog = unifrnd(logminmax(1), logminmax(2)); ...

quasi 2 anni fa | 0

Risposto
How to optimize condition code?
for cnt=1:10 if (cnt == 1 && a(cnt) == 0) || (cnt>1 && (a(cnt) == 0 || a(cnt-1) == 1)) statement A; else statement B; ...

quasi 2 anni fa | 0

| accettato

Risposto
To fill the value from the variable until the Num counts
time = [5.10616303,9.433357995,13.76055296,18.08774792,23.19391095,29.37822416,35.56253737,40.66870040]; T = length(time); num...

quasi 2 anni fa | 0

| accettato

Risposto
how to design a single cycle square wave?
% For single square pulse, you can specify: % pulse width: pw % simulation time: T f0=2.25e6; pw = 1/f0/2; fs=100e6...

quasi 2 anni fa | 0

| accettato

Risposto
How to plot the 10th and 90th percentiles of the predictions?
load(websave("conf_int.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1121675/conf_int.mat")) whos P = ...

quasi 2 anni fa | 0

Risposto
Error using vertcat ; Dimensions of arrays being concatenated are not consistent.
beta = 0.1; delta = 0.05; max_time = 100; S0 = 0.95; I0 = 0.05; R0 = 0.0; dXdt = @(t,X) [ -beta*X(1)*X(2); beta*X(1)*X(2)-...

quasi 2 anni fa | 1

Risposto
How to label the longitudinal axis with positive and negative values ?
load coastlines geoplot(coastlat,coastlon,"b", 'LineWidth' ,1) geobasemap topographi geolimits([-30 30],[130 -130]) box on ...

quasi 2 anni fa | 0

| accettato

Risposto
I want to know how to writ code to net1 = train(net,input,z) but z is double(complex)??
net1 = train(net,input,[real(z) imag(z)])

quasi 2 anni fa | 0

Risposto
How to plot discontinous function f(x,y)
syms x y z f(x, y) = x-.8193318913*sin(x)*cos(x)/(cos(x)^2+sinh(y)^2)-(0.2931044702e-2*(0.7500000000e-3*x^2-0.7500000000e-3*y^2...

quasi 2 anni fa | 0

Risposto
Convert a integer matrix to a red and blue colored matrix
A = [-1 1 1; 1 -1 1; -1 -1 -1] imagesc(A); % select a colormap cmap = hsv(8); % based on hsv cmap = cmap(...

quasi 2 anni fa | 0

| accettato

Risposto
extract the last value from each cell in array?
max_iterations = 500; max_iterations = 500; xs = 1 : max_iterations; websave('transRewards_40_0.1_2.csv', 'https://www.mathwo...

quasi 2 anni fa | 0

Risposto
make mx1 size array with m number of inputs
%zai=[ 0.0 0.4 0.2 0.3 0.4]; %I want to change the size of this array based on inputting the size value and I will give the n n...

quasi 2 anni fa | 0

Risposto
Applying free space path loss to a SNR formula
distance=0.02; %distance between ue and eNb in km F= 10; %frequency in MHz No= -174; %noise in dBm/Hz PL = 20*lo...

quasi 2 anni fa | 0

Carica altro