Risposto
StackedPlot with separate events
Maybe something like this is good enough: %make timetable times=[1, 2, 5]'; s=seconds(times); variable=[3, 4, 5]'; T=table(...

25 giorni fa | 0

Risposto
How to make directions bigger in current plot?
h = loopCircular; % first, a plot with the original size arrows, for comparison current(h,70e6,'Direction','on'); % next, a...

25 giorni fa | 1

Risposto
Assigning correct symbols and colors to group scatterplot
load gscat.mat gscatter(x,y,g,repelem('rkgb',1,3),repmat('o*h',1,4),6,'on','Hind','Twin') legend('Location','northeastoutsid...

25 giorni fa | 0

| accettato

Risposto
Use file name to save .mat files
[FileName,PathName] = uigetfile('*.dat','Select the .dat-file(s)','MultiSelect','on'); if isnumeric(FileName) return en...

26 giorni fa | 0

| accettato

Risposto
Extracting neighbouring cells in a cell array
B = [1,2,2,1,1; 2,1,2,1,2]; V = 1:size(B,2); A = accumarray(B.',V(:),[],@(m){m.'}) C=[1 2; 1 2] % construct NbhInd (a ce...

26 giorni fa | 0

| accettato

Risposto
Is there a way to rename a file to one that contains certain strings?
Altitude = 2000; Mach = 0.7; old_file_name = 'output.txt'; new_file_name = sprintf('Output%gft%gm.txt',Altitude,Mach); m...

26 giorni fa | 1

| accettato

Risposto
How to assign pair of values to a single aeeay in the matrix using two different vectors
fsine=50e6:0.4e9:3e9; Vp=0:0.5:3; result = repmat(Vp(:),1,numel(fsine))

27 giorni fa | 0

Risposto
Add together two stem plots
%Parameters fs = 16e3; t = 0:(1/fs):0.03; t = t(:); % ensure column vector numFilts = 32; filter_number = 10; range = ...

28 giorni fa | 2

| accettato

Risposto
i would like to know why my code doesn't work please, the data load factors is supposed to be taken from a .txt file from DASL website
There are a few problems that I see: 1. In MATLAB, return doesn't take arguments, so you don't say return (mean, median; stdde...

28 giorni fa | 0

| accettato

Risposto
Some problems using map/container with if-else statement in nested for loops
Intensitysol1 is not defined because the condition "if size(a)==2" is never true. size() returns a vector, and comparing a vecto...

28 giorni fa | 0

| accettato

Risposto
Logic statement error checking an array within a cell within a table
settingsSet.podList = load('podList.mat').T; settingsSet.podList Nrows = size(settingsSet.podList,1); VarNamesContainsPressur...

30 giorni fa | 0

Risposto
How to expand a row of values into a matrix, such that each new value is equal to the value above it plus one?
v = [5 10 15]; n = 3; m = v+(0:n-1).'

30 giorni fa | 0

| accettato

Risposto
varargin error for optional inputs
The problem is that varargin is not defined. Typically varargin refers to input arguments passed to a function. The code you are...

30 giorni fa | 1

| accettato

Risposto
A border/perimeter/rectangle around the inset plot, in a subplot environment
Here are a couple of options: fig = figure; for i = 1 : 6 subplot(3,2,i) scatter(rand(1,10),rand(1,10)) end ax = a...

circa un mese fa | 1

| accettato

Risposto
Operation with big files
F = load('Amplitudes.mat').F; N = load('NumberofDofs.mat').NumDof; NF = size(F,2); C = mat2cell(F,N,ones(1,NF)); NN = nume...

circa un mese fa | 0

Risposto
readmatrix() returning "NaN" for all data cells
You can have readmatrix exclude a certain number of lines at the start of the file by specifying the NumHeaderLines argument. I...

circa un mese fa | 1

| accettato

Risposto
loop plot add text to only one specific plot year
If I understand the task correctly, you can use an if condition to create the text object only when datedata is 2020 or 2021. E...

circa un mese fa | 0

| accettato

Risposto
Can not use arrays of ui components in app desiger
One thing you can do is construct the array of components in the app's startupFcn, e.g.: N = 64; app.MemValue = gobjects(1,N);...

circa un mese fa | 3

| accettato

Risposto
join rows in a cell matrix with the row above
Something like this may work on your files (if not, upload a sample file using the paperclip button): file_in = 'input.txt'; f...

circa un mese fa | 0

Risposto
Disabling integer overflow capping for uint8 datatypes
I don't think you can disable integer overflow capping, but you could of course perform the operations on corresponding floating...

circa un mese fa | 0

Risposto
Index in position 1 is invalid. Array indices must be positive integers or logical values.
At least one element of y is not a positive integer so can't be used as an index in image_matrix.

circa un mese fa | 0

Risposto
Identify when a exceedance occurs and return the start point and length of each exceedance
One way is to use strfind to find the starts and ends of the sections where hdgdelta>=6: hdg1=[10;10;10;10;10;10;10;10;10;10;10...

circa un mese fa | 0

Risposto
Running a loop of inputting tables into MatLab
First generate the file names. Since you know it's trials 5-40, you can do this: filenames = "/Volumes/usb/table_" + (5:40) + "...

circa un mese fa | 0

| accettato

Risposto
I'm confused about how to determine the delimiter between columns for data like this
Use fixedWidthImportOptions, e.g.: opts = detectImportOptions(filename,'FileType','fixedwidth'); % modify opts as necess...

circa un mese fa | 0

| accettato

Risposto
Parsing and editing txt file line by line
filename_in = 'test.txt'; filename_out = 'test_out.txt'; % show the input file's content, for reference type(filename_in) ...

circa un mese fa | 0

| accettato

Risposto
MATLAB not indexing table with correct data type, how to specify data type when indexing table?
Setting 'TextType' is for specifying whether the data readtable imports as text should be returned as string arrays or character...

circa un mese fa | 1

| accettato

Risposto
How to compare values between two NxM matrices
discrepancy_columns = find(any(altitude_data<DEM_data,1));

circa un mese fa | 0

| accettato

Risposto
I want show ylabel like 36m, 38m, 40m on plot I have variable population, plz help
P_0 = 1e6; % Initial population (1 million) r = 0.02; % Annual growth rate (2%) t = 0:0.1:50; % Time in years from 0 to 50 ...

circa un mese fa | 0

| accettato

Risposto
Find index of a nearest value
x = [1 2 3 4 5 6 11 15 21 51 52 54 100 101 151 201 251 301 401]; target = [10, 20, 50, 100, 150, 200, 250, 300, 400]; [~,idx...

circa un mese fa | 1

Carica altro