Respondida
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...

más de 3 años hace | 1

| aceptada

Respondida
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 ...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 1

| aceptada

Respondida
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')

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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")

más de 3 años hace | 1

Respondida
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/...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

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

más de 3 años hace | 0

Respondida
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(...

más de 3 años hace | 0

| aceptada

Respondida
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 ...

más de 3 años hace | 0

Respondida
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 ...

más de 3 años hace | 0

Respondida
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)

más de 3 años hace | 1

| aceptada

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

Respondida
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})...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

Respondida
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)); ...

más de 3 años hace | 0

Respondida
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; ...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

| aceptada

Respondida
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 = ...

más de 3 años hace | 0

Respondida
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)-...

más de 3 años hace | 1

Respondida
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 ...

más de 3 años hace | 0

| aceptada

Respondida
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)])

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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(...

más de 3 años hace | 0

| aceptada

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Respondida
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...

más de 3 años hace | 0

Cargar más