답변 있음
Trying to extract numbers between bounds and counting them
If you can use logical vectors then you can do it like this x = randi(100,10,1); count = sum(x >= 60 & x < 70); If you have t...

거의 6년 전 | 0

답변 있음
Replacing a whole row of a matrix with specific characters
a = char(randi([0 1],4000,5)+'0'); % create a n by 5 char array b = bin2dec(a); % convert it to decimal b(b>25) = b(b>25) - 'A...

거의 6년 전 | 0

답변 있음
Converting cell array to matlab datetime format
we can replace the gmt with utc t = {'03.08.2003 23:00:00.000 GMT+0200'}; t = strrep(t,'GMT','UTC'); t = datetime(t,'InputFor...

거의 6년 전 | 1

| 수락됨

답변 있음
Assign mean and max value to a heatmap color bar
You can specify the color limits in your heat map %h = heatmap(__,'ColorLimits',[0 10])

거의 6년 전 | 1

| 수락됨

답변 있음
How to find and replace the content of an array
% sometimestamp = {'03/07/2019' '03/07/2019 00:30:00'}; l = cellfun(@length,sometimestamp); % or % l = strlength(sometimest...

거의 6년 전 | 0

| 수락됨

답변 있음
"Next Button" and "command window" in App Designer
Make an app and add two properties. Filelist and currentidx and a placeholder for image in the app. Make a function called load...

거의 6년 전 | 0

| 수락됨

답변 있음
How to assign the value to the min/max of a color map in heatmap?
You can flip the colormap summer to get your desired colorscheme. f = figure; a = heatmap(rand(10,10),'Parent',f); colormap(f...

거의 6년 전 | 1

| 수락됨

답변 있음
How to rotate and rescale a portion of a class images in an image datastore network ?
You can use the augmentedImageDataStore. It will randomly apply the specified agumentation to the images. https://www.mathworks...

거의 6년 전 | 0

답변 있음
slow down the for loop operation for huge set of datas
You don't need to use the for loop with the inpolygon function. idx = inpolygon(X(:),Y(:),LocationsListData.x,LocationsListData...

거의 6년 전 | 0

답변 있음
How to seperate an array into two?
You can directly index into your 1-D vector. V = rand(8,1); n = length(V); Vodd = V(1:2:n); Veven = V(2:2:n);

거의 6년 전 | 0

답변 있음
I have an equation with 3 variables that each have an allowable range of values, how can I compute all possible solutions by picking from the allowable range of values at random?
B = 1.71E11; F = @(E,Q,K) E.*B + Q.* (B./K); mnE = 0.02; mxE = 0.06; numval = 100; E = rand(numval,1) .*(mxE-mnE) + mnE; % ...

거의 6년 전 | 1

| 수락됨

답변 있음
How to read and write to global variables of shared library(using loadlibrary)?
You need to get the pointer first. Try the following to see if it works. Also you did not specify what data type the pointer i...

거의 6년 전 | 0

| 수락됨

답변 있음
Bar chart with numerical x-axis treated as labels OR with thicker "bars"
categorical does not need you to supply the values as cellstring or string. You can straight away use it on a numerical array. ...

거의 6년 전 | 0

| 수락됨

답변 있음
Why my for loop does not work correctly?
for i = 1:numel(Class1_mon_avg_synop) j = (i-1)*2; ave(i) = Class1_mon_avg_synop{1,i}.sum_rrr24(i); ALLMONTHS_cla...

거의 6년 전 | 1

답변 있음
How to create a menu with checkbox in app designer?
There is a property "Checked" for uimenu. In app designer select the menu and in property inspector tick the checked box.

거의 6년 전 | 0

| 수락됨

답변 있음
How to extract text from .json files and combine them?
You can import your data into cell arrays filelist = {}; vals = cell(length(filelist),1); haveabstract = false(length(filelis...

거의 6년 전 | 0

답변 있음
How to calculate the highest consecutive negative results in my code
Assuming your vector is called a a = randi([-10 10],2000,1); ag0 = a>=0; % idx of val greater then a id = cumsum(ag0 | circsh...

거의 6년 전 | 1

답변 있음
Data comparison and storing
Humidity = str2double(Humidity(~ismissing(Humiditiy))); lowlimit = 40; highlimit = 50; outsidelimit = Humidity > highlimit ||...

거의 6년 전 | 0

답변 있음
Efficiently copying values from one table two another in which unique values are columns
C = unstack(B,'volatility','days'); The function unstack will do exactly what you are trying to do. The first column would be...

거의 6년 전 | 1

| 수락됨

답변 있음
Cannot create a pointer to a struct
You need to use the function libstruct https://www.mathworks.com/help/releases/R2020a/matlab/ref/libstruct.html https://www.ma...

거의 6년 전 | 0

답변 있음
How to add multiple legends in app designer ?
Add a display name to each plot. then turn on the legends at the end % example ax = axes; hold(ax,'on'); for i = 1:10 p...

거의 6년 전 | 1

| 수락됨

답변 있음
Run a Python Script to Stream Data
You should split your code into two functions. You can create a python function that instantiates the socket and return the soc...

거의 6년 전 | 1

답변 있음
Extracting repeated rows from table data based on conditions
% a = sometable, % assume no repeat of columns 6:7 for combination of 1:5 [b,ia,ic] = unique(a(:,1:5),'rows'); n = accumarra...

거의 6년 전 | 0

| 수락됨

답변 있음
Combine plots generated using for loop
Did you mean sub plots ? f = figure; tiledlayout(f,5,1); for i=1:5 ax = nexttile x = [0 : 0.01: 10]; y = i*sin...

거의 6년 전 | 0

답변 있음
How to apply function on columns while skipping certain columns
m = rand(31413,950); allcols = 1:950; exccols = 1:10:950; applcols = allcols(~ismember(allcols,exccols)); out = max(m(:,appl...

거의 6년 전 | 0

답변 있음
In MATLAB GUI, how can I display a set of elements such as edit text and slider only if I push the radiobutton?
If you are using app designer something like this will work for you. Essentially you can have an entire row or column of your g...

거의 6년 전 | 0

답변 있음
Please help with using accumarray to choose the max value of the array
% matrix = 11 x 3 ch = matrix(:,1); [u,~,ic] = unique(ch); maxba = accumarray(ic,matrix(:,2),[],@max); out = [u maxba]; i =...

거의 6년 전 | 0

답변 있음
Extract data from all values of a containers.Map collection
I assume that each of value in the container is a struct with identical fields. You can just get all the values like this % M...

거의 6년 전 | 0

답변 있음
Hey, Im trying to run this code but the run time is too long. can anyone help me out here plz
As a starting point you can vectorize your inner for loops m = repelem(1:s(1),1,s(2)); n = repmat(1:s(2),1,s(1)); a = cos((((...

거의 6년 전 | 0

| 수락됨

답변 있음
How to insert y-coordinate into plot next to each point
total_num_attacks=[0,1,2,3,4,5]; attack_kill_array=[0,.2,.31,.39,.43,.46]; kill_chance_increase=[0,0,.38,.18,.1,.06]; max_att...

거의 6년 전 | 0

더 보기