Réponse apportée
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...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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')

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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")

plus de 3 ans il y a | 1

Réponse apportée
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/...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
How to turn a dataset into a matrix
doc readmatrix doc readtable

plus de 3 ans il y a | 0

Réponse apportée
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(...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 3 ans il y a | 0

Réponse apportée
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 ...

plus de 3 ans il y a | 0

Réponse apportée
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)

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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})...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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)); ...

plus de 3 ans il y a | 0

Réponse apportée
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; ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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 = ...

plus de 3 ans il y a | 0

Réponse apportée
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)-...

plus de 3 ans il y a | 1

Réponse apportée
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 ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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)])

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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(...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Réponse apportée
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...

plus de 3 ans il y a | 0

Charger plus