Risposto
integral function gives the wrong answer
To define myfun, you need to ensure that it accept a vector argument x. The original code has problem when x is a vector (if x<...

circa 2 anni fa | 1

| accettato

Risposto
Matlab is holding on to a lot of memory. Is this expected?
Yes. It seems that your memory usage is "typical" (similar to mine). MATLAB itself takes up memory, in addtion to variables. ...

circa 2 anni fa | 0

| accettato

Risposto
Creating Table from csv files.
Folder=pwd; %'C:\Users\user\Desktop\7-19-22' mat = dir(fullfile(Folder, '*.csv')); uall = []; for files_i = 1:length(mat) ...

circa 2 anni fa | 1

| accettato

Risposto
How do you convert all the dates in a table within a column to a character?
If you use readtable, your date and time columns are already in cell char format as shown below. %x = readtable("https://www.ma...

circa 2 anni fa | 0

Risposto
How does matlab draw the following image?
clf ax = axes; hold on view(3) grid on % The arrows (vertical) [xs, ys, zs] = sphere(50); [xc, yc, zc] = cylinder(0.5...

circa 2 anni fa | 0

| accettato

Risposto
I want to draw a graph using circular layout with some nodes inside a circular layout.
s = [2 3 4 7 8]; t = [1 6 7 8 5]; G = graph(s,t); % Remove node 8 from gra[h G1 = rmnode(G, ...

circa 2 anni fa | 0

Risposto
Convert quartely to monthly using formula
Since you have 457 months of observation, which is not integer multiples of 3 months or quaaters. You have to decide to what to...

circa 2 anni fa | 0

| accettato

Risposto
how to convert a tif image to a m-by-n-by-3 array
[a, cmap] = imread("corn.tif"); subplot(121); imshow(a, cmap); b = ind2rgb(a, cmap); subplot(122); imshow(b); whos b

circa 2 anni fa | 0

Risposto
How to normalize an integer matrix, with center at 0 and range between [-1 1]
Depending on your data, try some of the following: x = randi([-190 540], [59, 15]); subplot(221); imagesc(x); colorbar subplo...

circa 2 anni fa | 0

Risposto
How to change the input size in first layer of Resnet?
Change input layer may requires new training (not transfer learning): nresnet = resnet50; n = [imageInputLayer([112 112 3]); n...

circa 2 anni fa | 1

Risposto
about convert time data and plotting
load("TDD.mat") %TDD subplot(121); plot(datetime(TDD(:,2),'ConvertFrom','datenum'), TDD(:,1), '.'); datetick('x', "mm/dd")...

circa 2 anni fa | 0

| accettato

Risposto
1-sigma error from data
x = 500*randn(10000, 1) + 200; % some data mx = mean(x); sx = std(x); plot(x, 'o'); hold on; grid on; yline(mx+[-...

circa 2 anni fa | 0

| accettato

Risposto
How do I set element gain for phased array
freq = [0 1000 2000]; % freq vector resp = [3 3 3]; % response in dB at different freq a = phased.CustomAntennaEle...

circa 2 anni fa | 0

Risposto
Matlab variable rounding issue
B_WD = [ 738226.7222 0.0000 -0.3000 -0.8000 738226.7292 0.0000 0.2000 -0.5000 738226.7361 0.0000 0.3000 -0.5000...

circa 2 anni fa | 0

Risposto
Remove duplicate edges of undirected graph
% A graph with duplicated edges s = [1 1 1 1 1 2 2 3 3 3 3 5 5]; t = [2 3 4 4 6 1 5 4 4 5 6 4 6]; names = string(1:6); G = g...

circa 2 anni fa | 1

Risposto
Calculating the mean and standard deviation of a struct array (contains 7000 1*2000 array). GPU Arrayfun computation is much slower than CPU.
I did a test on my machine with an old GPU card (Quadro P5000) and 44 core cpu. Here is the result: a = randn(7000, 2000) mcp...

circa 2 anni fa | 0

| accettato

Risposto
vectorization of for loop
function o_lmat = reassign_label(o_lmat,h,w,p,n_prev) % for a = 1:h % for loops to reassign labels % for b = 1:w % ...

circa 2 anni fa | 0

| accettato

Risposto
How to modify the distance between the numbers and the bar and increase tick width in a matlab colorbar?
x = randi([-4 4], [8 7]); subplot(121); imagesc(x); colormap(jet) h1 = colorbar; subplot(122); imagesc(x); colormap(jet) ...

circa 2 anni fa | 0

Risposto
How to save and append variable into a matlab file?
You can use mat-file objuect. doc matfile for mor details. % work with the .mat file using matfile object matobj = matfile('pa...

circa 2 anni fa | 0

| accettato

Risposto
How to plot a special plane x-y=5 with surf function
x = (-10:10)'; y = x - 5; z = [-10 10]'; nz = length(z); xx = x*ones(1, nz); yy = y*ones(1, nz); zz = ones(length(x), 1)...

circa 2 anni fa | 0

Risposto
how to use an array as the input variable for function
% Now I want to use below array as the input to call above function. Input_data=[1 2 3 4 5]; %feval(myfunc, [1 2 3 4 ... n])...

circa 2 anni fa | 1

| accettato

Risposto
Plot a 2d figure for a complicated function
vplc=0.25;delta=2.5;tau_max=44000;Ktau=0.045;%tauP=0.027; kc=0.1; kh=0.05;Vp=0.9;Kbar=0.000015;kp=0.15;gamma=5.5;kb=0.4; Vpm=0...

circa 2 anni fa | 0

Risposto
Remove node and reconnect edges in graph
s = [1 1 1 1 2 2 3 3 3 5 5]; t = [2 3 4 6 1 5 4 5 6 4 6]; names = string(1:6); G = digraph(s, t, [], names); h1 = plot(G);...

circa 2 anni fa | 1

| accettato

Risposto
couldn't understand what's wrong in the function definition.
a =1; P=2; i=3; tf=4; k=5; l=6; tc=7; o=8; f = @(t,y) [ ( (y(2)-a-l.*(abs(cos(y(3)+ pi/4)) )).*y(1) + k.*y(1).*cos(y(3)- pi/2)...

circa 2 anni fa | 0

Risposto
Please help me solve this differential equation
opts = odeset('RelTol', 1e-2, 'AbsTol', 1e-4); [t, x] = ode45(@diffeqn, [0 1], [0.1; .1], opts); whos plot(t, x(:,2)) ...

circa 2 anni fa | 1

Risposto
There's no execution icon anywhere.
Not sure what casuses the problem. But there is a work around you can try: Go to the install directory: Your_Instal_Directory...

circa 2 anni fa | 0

| accettato

Risposto
Function "Ismember" is giving me an error message
Does the following help? A = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1069865/General_Prompt.x...

circa 2 anni fa | 0

| accettato

Risposto
how to normalization starting of the curves in same point ?
load DATA.mat %total = total./total(1, :); total = total./total(1, :)*total(1,1); plot(total)

circa 2 anni fa | 1

| accettato

Risposto
How to increase spacing between axis ticks in plot with a lot of data
A figure/screen/paper has limitted size. You may want to display them in subplot to maximize the screen asset. fakedata = [lin...

circa 2 anni fa | 0

Risposto
How to manipulate xtick labels?
What else do you need in addition to the following? plot(1:21,1:21); Year_List = {'1984'; '1986';'1988';'1990';'1992';'1994'...

circa 2 anni fa | 0

Carica altro