統計
All
Feeds
回答済み
how do I load zip file in matlab code?
Use <https://www.mathworks.com/help/matlab/ref/unzip.html unzip> to extract the files from the zip archive. Then read/load the r...
how do I load zip file in matlab code?
Use <https://www.mathworks.com/help/matlab/ref/unzip.html unzip> to extract the files from the zip archive. Then read/load the r...
1日 前 | 0
回答済み
How can I write data to a text file in a user-specified location that is already populated with a standard header?
You can call writematrix with 'WriteMode','append' to write the data to a text file that already contains the header. So the co...
How can I write data to a text file in a user-specified location that is already populated with a standard header?
You can call writematrix with 'WriteMode','append' to write the data to a text file that already contains the header. So the co...
1日 前 | 0
| 採用済み
回答済み
How to correctly adjust the FaceColor property of patch objects in a figure with a legend?
fig = openfig('cylinder.fig','visible'); There are actually 12 patches in the figure all_patches = findall(fig,'Type','patch')...
How to correctly adjust the FaceColor property of patch objects in a figure with a legend?
fig = openfig('cylinder.fig','visible'); There are actually 12 patches in the figure all_patches = findall(fig,'Type','patch')...
2日 前 | 1
| 採用済み
回答済み
undo a command in matlab plotting in 2d
In the figure window go to Tools menu > Edit Plot. Using the mouse cursor select the line you want to remove, then either right-...
undo a command in matlab plotting in 2d
In the figure window go to Tools menu > Edit Plot. Using the mouse cursor select the line you want to remove, then either right-...
3日 前 | 0
回答済み
Issue with plotting order
Data = readmatrix("FigureOfMeritResults.xlsx"); % Extract data Date = Data(469:1908,1); FoM = Data(469:1908,3); GHI = Data(4...
Issue with plotting order
Data = readmatrix("FigureOfMeritResults.xlsx"); % Extract data Date = Data(469:1908,1); FoM = Data(469:1908,3); GHI = Data(4...
3日 前 | 0
回答済み
Plots coming out weird
You likely have pre-existing X and Y variables in your workspace, which are being plotted in their entirety. Since the code show...
Plots coming out weird
You likely have pre-existing X and Y variables in your workspace, which are being plotted in their entirety. Since the code show...
4日 前 | 0
回答済み
Separating and indexing (k-wave) datasets to different planes/coordinates
One way to separate the the data for the two sensors is using the following approach % Extraer resultados de sensor1 y sensor2 ...
Separating and indexing (k-wave) datasets to different planes/coordinates
One way to separate the the data for the two sensors is using the following approach % Extraer resultados de sensor1 y sensor2 ...
5日 前 | 0
回答済み
assign the fields of a structure correctly
Assuming the set of table variable names is the same between d1 and app.Preset_UITable.Data (but potentially in a different orde...
assign the fields of a structure correctly
Assuming the set of table variable names is the same between d1 and app.Preset_UITable.Data (but potentially in a different orde...
5日 前 | 1
| 採用済み
回答済み
Why converting from Spherical to Cartesian using the command "sph2cart" gives different values than converting it manually by writing the equations of each coordinate?
Assuming theta is azimuth and phi is elevation, your equations would be (from the documentation): x = r .* cos(phi) .* cos(thet...
Why converting from Spherical to Cartesian using the command "sph2cart" gives different values than converting it manually by writing the equations of each coordinate?
Assuming theta is azimuth and phi is elevation, your equations would be (from the documentation): x = r .* cos(phi) .* cos(thet...
6日 前 | 1
| 採用済み
回答済み
Turning a 1x3001 array into a 14x3001 array to make two things the same size and perform math on them...
You don't have to explicitly repeat the 1x3001 row vector 14 times in order to add it to the 14x3001 matrix. Here's an example ...
Turning a 1x3001 array into a 14x3001 array to make two things the same size and perform math on them...
You don't have to explicitly repeat the 1x3001 row vector 14 times in order to add it to the 14x3001 matrix. Here's an example ...
6日 前 | 0
| 採用済み
回答済み
how to make figure full axes
Setting the figure's WindowState property to 'fullscreen' may achieve the desired effect, e.g.: fig = figure('Units', 'pixe...
how to make figure full axes
Setting the figure's WindowState property to 'fullscreen' may achieve the desired effect, e.g.: fig = figure('Units', 'pixe...
7日 前 | 1
| 採用済み
回答済み
Why do I get "Array indices must be positive integers or logical values" error ?
When i is 100, Per(100-i) is Per(0), which causes the error since 0 is not a valid index in MATLAB.
Why do I get "Array indices must be positive integers or logical values" error ?
When i is 100, Per(100-i) is Per(0), which causes the error since 0 is not a valid index in MATLAB.
8日 前 | 2
回答済み
Why does Tiledlayout return error when using a figure with datetime as x-axis?
datetime x-axis is supported in tiledlayout. Here's an example: x = datetime(2024,9,3):hours(1):datetime(2024,9,5); y = rand(s...
Why does Tiledlayout return error when using a figure with datetime as x-axis?
datetime x-axis is supported in tiledlayout. Here's an example: x = datetime(2024,9,3):hours(1):datetime(2024,9,5); y = rand(s...
8日 前 | 1
| 採用済み
回答済み
How to use different colormaps for different function in mesh plot.
Here is one way: % data x = linspace(-3,3,100); y = linspace(0,3,100); [X,Y] = meshgrid(x,y); Rho2 = X.*X + Y.*Y; Z = exp(-...
How to use different colormaps for different function in mesh plot.
Here is one way: % data x = linspace(-3,3,100); y = linspace(0,3,100); [X,Y] = meshgrid(x,y); Rho2 = X.*X + Y.*Y; Z = exp(-...
8日 前 | 1
| 採用済み
回答済み
Plot multiple graphs on the figure using plot(y,linespec)
Use hold on y_vec_1 = rand(1,10); y_vec_2 = rand(1,15); y_vec_3 = rand(1,20); figure(); plot(y_vec_1,'*-r');%gz; hold on...
Plot multiple graphs on the figure using plot(y,linespec)
Use hold on y_vec_1 = rand(1,10); y_vec_2 = rand(1,15); y_vec_3 = rand(1,20); figure(); plot(y_vec_1,'*-r');%gz; hold on...
9日 前 | 0
回答済み
2×0 empty double matrix
"why is SAB21 returning " 2×0 empty double matrix"?" Because the expression 2:1 evaluates to an empty vector. SAB21 = SB (3:4,...
2×0 empty double matrix
"why is SAB21 returning " 2×0 empty double matrix"?" Because the expression 2:1 evaluates to an empty vector. SAB21 = SB (3:4,...
9日 前 | 0
| 採用済み
回答済み
Can I used Unique to find unique x,y,z coordinates in table data?
load('matlab.mat') T = summaryTable1 [g_idx,result] = findgroups(T(:,[1 2 3])); vars_1 = {'meanZm','meanGAIpred'}; vars_0 = ...
Can I used Unique to find unique x,y,z coordinates in table data?
load('matlab.mat') T = summaryTable1 [g_idx,result] = findgroups(T(:,[1 2 3])); vars_1 = {'meanZm','meanGAIpred'}; vars_0 = ...
9日 前 | 0
回答済み
Import mutilple excel files and save then individually as matlab tables, and finally synchronize the timetables
% specify source and destination directories source_dir = 'C:\Wind_Data_Rows_Deleted_2023\test'; dest_dir = 'C:\Wind_Forecast_...
Import mutilple excel files and save then individually as matlab tables, and finally synchronize the timetables
% specify source and destination directories source_dir = 'C:\Wind_Data_Rows_Deleted_2023\test'; dest_dir = 'C:\Wind_Forecast_...
9日 前 | 0
| 採用済み
回答済み
Set current axes by using axes() is not wokring
To plot like that in a uifigure, make the uifigure's HandleVisibility 'on' (it's 'off' by default), e.g.: app.UIFigure.HandleVi...
Set current axes by using axes() is not wokring
To plot like that in a uifigure, make the uifigure's HandleVisibility 'on' (it's 'off' by default), e.g.: app.UIFigure.HandleVi...
9日 前 | 0
| 採用済み
回答済み
Update UIAxes in App1 after computation in App2
% Button pushed function: GotoApp2Button function GotoApp2ButtonPushed(app, event) app.app1handle = findall(0, 'Name', 'My...
Update UIAxes in App1 after computation in App2
% Button pushed function: GotoApp2Button function GotoApp2ButtonPushed(app, event) app.app1handle = findall(0, 'Name', 'My...
10日 前 | 0
| 採用済み
回答済み
Storage columns of data from excel sheet on matlab table cell
"I want to create a matlab table" but you show a cell array. These methods create a cell array as you describe: Method 1: T = ...
Storage columns of data from excel sheet on matlab table cell
"I want to create a matlab table" but you show a cell array. These methods create a cell array as you describe: Method 1: T = ...
10日 前 | 1
| 採用済み
回答済み
Unable to use title() for image.
You have a variable called title preventing you from using the title function. Clear it: clear title and then run you...
Unable to use title() for image.
You have a variable called title preventing you from using the title function. Clear it: clear title and then run you...
11日 前 | 1
| 採用済み
回答済み
How to Remove Specific Rows in a Multi-Column Array Based on One Column's Values
data = [1:10; 0.3*rand(1,10)].' idx = data(:,2) < 0.1; data(idx,:) = [] The removal of the rows could also effectively be d...
How to Remove Specific Rows in a Multi-Column Array Based on One Column's Values
data = [1:10; 0.3*rand(1,10)].' idx = data(:,2) < 0.1; data(idx,:) = [] The removal of the rows could also effectively be d...
14日 前 | 0
回答済み
Count number of nucleotide bases (letters) in file with multiple entries
% this is what the attached file contains: type file.txt data = readlines('file.txt'); ID = regexp(data(1:2:end),'>(.*?):...
Count number of nucleotide bases (letters) in file with multiple entries
% this is what the attached file contains: type file.txt data = readlines('file.txt'); ID = regexp(data(1:2:end),'>(.*?):...
14日 前 | 0
| 採用済み
回答済み
A simple/efficient way to add one additional xtick, and the corresponding xticklabel, to the existing xticks and xticklabels
plot(1:50) new_tick = 5; ax = gca(); ax.XTick = unique([ax.XTick new_tick]);
A simple/efficient way to add one additional xtick, and the corresponding xticklabel, to the existing xticks and xticklabels
plot(1:50) new_tick = 5; ax = gca(); ax.XTick = unique([ax.XTick new_tick]);
14日 前 | 1
| 採用済み
回答済み
Logging cmd in multiple diary
You can restore diary logging to log1.txt after logger2 finishes: logger1(); function logger1() logName = fullfile(pwd,...
Logging cmd in multiple diary
You can restore diary logging to log1.txt after logger2 finishes: logger1(); function logger1() logName = fullfile(pwd,...
15日 前 | 0
回答済み
I am having trouble constructing a 'for loop'. Can you suggest me on how to modify it?
One thing I notice is that (-A)^i-1 should be (-A)^(i-1) EDIT: that's now corrected in the question.
I am having trouble constructing a 'for loop'. Can you suggest me on how to modify it?
One thing I notice is that (-A)^i-1 should be (-A)^(i-1) EDIT: that's now corrected in the question.
15日 前 | 1
| 採用済み
回答済み
Reading columns from a poorly-formatted text file
This file looks like a fixed-width file, but it's not quite, because lines 68 and 69 differ in format from the other lines. dbt...
Reading columns from a poorly-formatted text file
This file looks like a fixed-width file, but it's not quite, because lines 68 and 69 differ in format from the other lines. dbt...
15日 前 | 0
| 採用済み
回答済み
How to change Fontcolor xticks and yticks
Assuming you just want to change the color of the x-tick and y-tick labels: plot(1:10) ax = gca(); ax.XAxis.TickLabelColor ...
How to change Fontcolor xticks and yticks
Assuming you just want to change the color of the x-tick and y-tick labels: plot(1:10) ax = gca(); ax.XAxis.TickLabelColor ...
15日 前 | 0
| 採用済み
回答済み
Increasing the line width of box plot whiskers
findobj('Tag','boxplot') finds all* objects whose Tag is 'boxplot'. This includes any object whose Tag is 'boxplot' anywhere in ...
Increasing the line width of box plot whiskers
findobj('Tag','boxplot') finds all* objects whose Tag is 'boxplot'. This includes any object whose Tag is 'boxplot' anywhere in ...
15日 前 | 0
| 採用済み