94,688 questions
Advice
1
vote
2
replies
37
views
Why the statement '[a] = size(x)' does not assign the product of dimensions of 'x'?
The command help size shows that:
[M1,M2,M3,...,MN] = size(X) for N>1 returns the sizes of the first N
dimensions of the array X. If the number of output arguments N does
not equal NDIMS(...
-1
votes
0
answers
56
views
Dynamic Conditional Correlation (GARCH & Regime Switching) [closed]
I have been thinking about a new research project that I need to perform, Dynamic Conditional Correlation (with GARCH & Regime Switching) using financial data.
I need to know between MATLAB, ...
1
vote
1
answer
55
views
Simulink 2023b PV Model Outputs NaN Even With Constant Inputs — What Am I Missing?
I'm using MATLAB/Simulink 2023b and built a very simple PV model: constant irradiance (1000), a PV array block, and measurement blocks. But when I run the simulation, all outputs show NaN, even though ...
2
votes
0
answers
49
views
Display order for overlayed datasets in histogram
Let's say we have 3 datasets of the same size, that we want to plot on the same histogram:
Dataset_1 = [1 1 1 1 1 1 2 2 2 2 3 3];
Dataset_2 = [1 1 1 2 2 2 2 2 2 3 3 3];
Dataset_3 = [1 1 2 2 2 2 3 3 3 ...
Advice
1
vote
5
replies
87
views
How to show values from one matrix while coloring using another matrix with MATLAB heatmap?
This is the code from my current heatmap:
N = 36;
Lat_extended = [Latency; zeros(N*N - length(Latency), 1)];
Lat_matrix = reshape(Lat_extended, N, N);
figure;
heatmap(Lat_matrix)
And the figure,
The ...
1
vote
0
answers
53
views
Bad colormap interpolation when not using the default colormap
My code doesn't work well when I apply a custom colormap. It does well with the default colormaps; however, when I specify my own it doesn't work.
My current code is this:
mymap = [
0.769, 0.992, 1....
1
vote
0
answers
42
views
Extracting free spaces from a occupancy grid map in the MATLAB
How can I extract free spaces from a occupancy grid map in the MATLAB. I have the following code which gave the output that there is no free cell on the occupancy grid map.
clc;
clear;
close all;
rng(...
1
vote
0
answers
32
views
Configuration structure error with Fieldtrip in Matlab
I'm running into an error while attempting to setup a configuration structure for a single subjects EEG data using Fieldtrip. While I think the answer is plain, I am unable to figure out for the life ...
1
vote
0
answers
41
views
Want to get rid of "jagged teeth" from DTS simulator made in matlab
So I made a program in matlab that numerically simulates a DTS system and its almost right but there's one detail that there's "jagged teeth" in the graphic diagram ( circled in blue ) ...
-2
votes
0
answers
31
views
How to change size of marker in rltool matlab
I want to make my poles and zeros markers bigger. In PLOT I had this option in properties, but in rltool I don't have the same option. I've tried to use set(0, 'DefaultLineMarkerSize', 8); but this is ...
1
vote
0
answers
59
views
Reassigning a Matlab pointer in a loop without a memory leak
We are using Matlab to communicate with a C++ library, and are struggling with memory management.
We create a libpointer pointing to an array, and then try to update its value in a loop. I don't think ...
1
vote
0
answers
21
views
Grey Wolf Optimizer (GWO) MPPT in MATLAB/Simulink returns only lower bound value as reference speed
I am implementing a Grey Wolf Optimizer (GWO) for Maximum Power Point Tracking (MPPT) to generate the reference speed in a wind energy conversion system using Simulink.
However, when I run the ...
0
votes
0
answers
39
views
Ray tracing for the offner stretcher
Please help me refine the ray tracing code of the Stretcher Offner in MATLAB.
I used the formulas from the article to plot graphs from Figure 3, showing the dependence of the group delay on the ...
3
votes
0
answers
98
views
How can I plot diagonals of matrix?
I want to plot all the diagonals of a matrix. In the matrix row 1 contains information of time 1, row 2 of time 2 etc etc. Each diagonal presents the evolution of the number of fishes in a cohort that ...
-1
votes
1
answer
56
views
Matlab script to write to Excel file, have excel calculate, and read output in a for loop
I am trying to build a Matlab script to write data to an Excel file, have the excel file execute, and pull out another cell as the output. I asked an AI engine to give me a script and it came up with ...