Respondida
OOP: objects as properties of objects; objects with no methods; objects with no properties?
Is it OK to store other objects as properties of an object? Yes. Actually it is common for MATLAB class. Is it OK if "subob...

más de 3 años hace | 0

Respondida
How can I draw a bifurcation diagram for the given code?
When do array operation, you should use .^ or .*: k1 = 3; k_1 = 1; k2 = 2.5; k3 = 1; k_3 = 1; k4 = 2; k5 = 1; E1 = 1; E...

más de 3 años hace | 0

| aceptada

Respondida
search for a folder from a different directory
cfolder = pcd; cd YourRootFolder a = dir ("**/2022-05-24.*"); % ** for subfolders isempty(a) cd cfolder

más de 3 años hace | 0

Respondida
How to store variable name AND value in an array?
density = 456; pressure = 356 ; temperature = 66; % or use struct a.density = 456; a.pressure = 356 ; a.temperature = 66...

más de 3 años hace | 1

| aceptada

Respondida
Overwrite table data if the logical index of row is true.
load(websave("sample.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1108480/sample.mat")) sampleinput i...

más de 3 años hace | 0

| aceptada

Respondida
In 3D plot, how is the image displayed on a specific 3D spatial plane?
srcImg = imread("peppers.png"); sz = size(srcImg); [xx, yy] =meshgrid(1:sz(1), 1:sz(2)); zz = ones(size(xx)); % set the z ...

más de 3 años hace | 1

| aceptada

Respondida
How to label Y_ticks for a multi line plot using a for loop
all_trials = randn(15, 15)*.1; channel_n = size(all_trials, 2); %all_trials = ones([15,15]); x_axis = linspace(-0.1, 0.3, siz...

más de 3 años hace | 0

| aceptada

Respondida
Extract functionality from add-on to run program without add-on
MATLAB has a tool to find the required files for running a program. % files = "YourMainMatlabFile.m" [fList, pList] = matlab.c...

más de 3 años hace | 0

Respondida
svd(X,"econ") does not work as expected if X is square nxn matrix with rank<n
X=[1 1;1 1] [U,S,V]=svd(X,"econ") %I had expected that U=V=[1;1]/sqrt(2) and S=[2]. %But "econ" does not work, S=[2 0;0 0] a...

más de 3 años hace | 0

Respondida
Get Drive Volume information
For windows machine, you can do the following: [status, outpyt] = system("wmic diskdrive get model,serialnumber")

más de 3 años hace | 0

Respondida
How to save ".txt" to ".mat"?
data=dlmread('RO-2013-equinox.txt'); save('RO-2013-equinox.mat', 'data'); % quote the variable name

más de 3 años hace | 1

| aceptada

Respondida
Matlab plot is not correct
f = @(t,y,s) (0.0012*((1-y)/(1.66*10^(6)))+s-0.0012*0.02*y); %y=Nddotexi,vmed=0.02,fdot=3*10^(-18),r=0.0012,k=Nsurv a = 0; %i...

más de 3 años hace | 0

| aceptada

Respondida
How do I plot two different variables on the same graph but in two different colors?
clc t=0:(0.0625):100; x=sin(t).*(exp(cos(t))-(2.*cos(4*t))-(sin(t/12).^5)); y=cos(t).*(exp(cos(t))-(2.*cos(4*t))-(sin(t/12).^...

más de 3 años hace | 0

Respondida
how to find power spectral density of signal using fft
Here is the example from matlab documentation: https://www.mathworks.com/help/signal/ug/power-spectral-density-estimates-using-f...

más de 3 años hace | 0

Respondida
How do I insert one array into another?
a = reshape(1:12, 3, 4) b = reshape(13:24, 3, 4) % You stack a and b, then reshape it a = reshape([a; b], 3, 8)

más de 3 años hace | 0

| aceptada

Respondida
how to iterate powers? example 5^5 = 5*5*5*5*5
% potencia % x=input("introducir numero"); x = 5; n=1; xn = 1; while n<=5 xn = xn * x; fprintf("x^%d = %...

más de 3 años hace | 0

Respondida
removing values, connect lines and change thickness of border in a polar plot
theta = 0:.01:2*pi; rho = sin(2*theta).*cos(2*theta); polarplot(theta, rho); h = gca; h.RTickLabel = []; % remove rho valu...

más de 3 años hace | 0

| aceptada

Respondida
How to get xticklabels from xticks by merging cells?
plot(randn(7,1)) Xticks = 1:2:7; % for example % It's simpler and neater to use string Xtickslabels = string(Xticks)...

más de 3 años hace | 0

| aceptada

Respondida
How to find the end value of a flat minimum peak in a noisy data?
load(websave("angle.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1106205/angle.mat")) whos t = 1:leng...

más de 3 años hace | 1

Respondida
Display plots as movie without pause()
t = 0 while true plot( sin(x)sin(y)(cos(t) ) % this is just psudocode anyways, doesn't matter %pause(.1) drawno...

más de 3 años hace | 0

Respondida
Extracting index of specified date from datetime array in dd:MM:yyyy:HH:mm:ss.SSS format
TimeMatlab = [738249.003472956,738249.003530829,738249.003588699,738249.003646569,738249.003704439]; Time=datetime(TimeMatlab,'...

más de 3 años hace | 0

| aceptada

Respondida
Calling a Function specific from a ToolBox
seriesnetwork is a calss. It has a method of "classify". In order to use the method, you need to create the network and trai...

más de 3 años hace | 0

Respondida
how can I have a single number as the result of dividing two numbers?
load(websave("matalb.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1104765/matlab.mat")); [M1, N] = siz...

más de 3 años hace | 0

Respondida
Find correlation coefficient between a row in a data and every row in another data
A = randn(1, 5); B = randn(10, 5); r = zeros(10,1); for i=1:10 tmp = corrcoef(A, B(i, :)); r(i) = tmp(1,2); end i...

más de 3 años hace | 0

Respondida
If inside of for loop is not working
k = 1; dx = (3-0)/4; dy = 1/10; y1 = 0; y2 = y1 + dy; x1 = 0; x2 = x1 + dx; while y1 <=1 && x2 <=3 %[k, y1, x2] g{k...

más de 3 años hace | 0

Respondida
How can i solve "Index exceed the number of array problem(1)
Not sure what you want to do with the code without background info. It seems that you need to specify "Nddotsur" as a vector. ...

más de 3 años hace | 0

| aceptada

Respondida
Moving Std Dev for 20 periods
a = randn(3000, 100); b = movstd(a, 20, 0, 2, 'omitnan');

más de 3 años hace | 0

Respondida
How to show partial legend in a loop
f = figure; hold on for j = tt_n' % h1{j}=plot(Y, D{h}{j},'color',getprop(colors,j), 'linestyle',getprop(linestyle,j)...

más de 3 años hace | 0

| aceptada

Respondida
what is wrong in this code not executing .??????Error: File: ifSf.m Line: 2 Column: 22 Invalid expression. Check for missing multiplication operator, missing or unbalanced del
%function[y,z]=ifSf(x,245131.735,16960.70,0) function[y,z]=ifSf(x) % for function definition, arguments must be variables (not...

más de 3 años hace | 0

Respondida
Extracting specific data for multiple mat files
fn = dir("save*.mat") for i = 1:length(fn) matobj{i} = matfile(fn(i).name) matobj{i}.PCD % Then you can access to an...

más de 3 años hace | 1

Cargar más