Community Profile

photo

Mohammad Sami


Last seen: 3 days ago
82 total contributions since 2014

Mohammad Sami's Badges

  • 3 Month Streak
  • Knowledgeable Level 3
  • Revival Level 1
  • First Answer
  • Speed Demon
  • Solver

View details...

Contributions in
View by

Answered
changing continuous transfer function
You should just define your transfer function as a function. You can then just pass in the values you want to evaluate on. H = ...

19 days ago | 0

Answered
Storing data in a real time recording gui using a callback
Instead of concatenating the data with every iteration, just store the data in a cell array. You can concatenate it when you nee...

20 days ago | 0

| accepted

Answered
Read Time from the column of CSV file for plotting purpose
readtable should work just fine with your data. a = readtable('Moxy.csv'); plot(a.hh_mm_ss,a.SmO2Live)

20 days ago | 0

| accepted

Answered
How to indicate if the program is processing in app designer?
Use the function dlg = uiprogressdlg(app.UIFigure); See documentation for all available options with the function.

21 days ago | 0

Answered
What can I do to further vectorise this code?
Have you tried the function islocalmax and islocalmin ? maxIndices = islocalmax(x(:,2)); minIndices = islocalmin(x(:,2));

22 days ago | 0

| accepted

Answered
How to assign points to one or several boxes
Would this be fine. The point C will be repeated twice as in two boxes. lat = [47.5, 45.5, 46.5]'; lon = [-63.5, -61.5, -62.5]...

22 days ago | 0

| accepted

Answered
Finding two layers to replace in googlenet
For R2018a, you can follow this tutorial. Essentially it shows you what the findLayersToReplace function was doing. For most tr...

22 days ago | 1

| accepted

Answered
comparing many plots with their peak values
load('test.mat'); [~,i1] = max(biggest_hg1); x1 = (1:length(biggest_hg1)) - i1; [~,i2] = max(biggest_hg2); x2 = (1:length(bi...

22 days ago | 1

| accepted

Answered
How do I import a table containing numbers in a picture with OCR?
Try resizing the image. It would hopefully improve the accuracy. a = imread('image.jpeg'); a = imresize(a,2); txt = ocr(a,'Ch...

22 days ago | 0

| accepted

Answered
How to create an array that picks every 3 numbers out of 5
a = reshape(1:665,5,[]); a(1:2,:) = []; a = reshape(a,[],1); a(:,2) = 0;

22 days ago | 0

Answered
how to get cumulative percentage
gs = cumsum(g); gs = gs / gs(end) * 100; plot(t,gs)

22 days ago | 0

| accepted

Answered
Random but equal distribution of numbers 1 and 2
You can try this l = 50 a = rand(l,1); a = (a > median(a)) + 1;

22 days ago | 0

Answered
join words for a title in plot
You have put '' around name. That makes it a static char name='function'; x = 0:pi/100:2*pi; y = sin(x); plot(x,y) title(['...

22 days ago | 0

| accepted

Answered
Ismember as a condition?
Yes needed to combine with the time column. load Obs.mat load WRF.mat WRF_Data.Date = WRF_Data.Date + duration(hour(WRF_Data...

23 days ago | 0

| accepted

Answered
Loop through sub folders.
mainfolder = uigetdir; subfolders = dir(mainfolder); subfolders = subfolders([subfolders.isdir] & ~startsWith({subfolders.name...

23 days ago | 0

| accepted

Answered
Find Interval in Array With Most Updates
Another option can be % this will work for integer times times = [1 2 3 4 6 7 10 12 14 15 17 19 20 21 29 30 32 34 36 37 40 41 ...

23 days ago | 0

Answered
summing elements of an array until a value appears
a = [1 1 1 2 3 4 2]; i = find(a==2,1,'first'); if ~isempty(i) val = sum(a(1:i)); else val = sum(a); end

23 days ago | 0

| accepted

Answered
saving multiple .mat files different names
[hdr,record] = edfread(muestra); recordname = sprintf('record_%i',trial); matFileName = matfile(fullfile(pwd, sprintf('angry_%...

23 days ago | 0

| accepted

Answered
How to display Heatmap plot in UI Axes of matlab app designer ?
Place Uipanel in the position you want heatmap. h = heatmap(app.Panel1,tbl,xvar,yvar);

24 days ago | 0

| accepted

Answered
How can I convert my code to the exe file?
If the user do not have admin rights, you can use the following workaround. I have tested this in Win10, but the system has Mat...

24 days ago | 0

Answered
How to find maximum value of each event present in a series ?
Another option data = readtable('2000.xlsx'); data.Date = fillmissing(data.Date,'previous'); % assume the data is in ascendin...

25 days ago | 1

| accepted

Answered
Add structs in a saved array of structures
You can use the matfile function to write directly to a mat file a = matfile('newfile.mat','Writable',true); n = 10; for i = ...

25 days ago | 1

| accepted

Answered
Is it possible to use the for-loop for this purpose?
You can use the for loop. Modify it as you deem fit. % load from xlsx or from your mat file. matching_station = readtable('tab...

26 days ago | 2

Answered
How to set shortcuts for zoom tool in my own GUI?
Just tested your code. turns out event key is in lower case. Just to safe (in case of capslock), lets convert the value to upper...

26 days ago | 0

| accepted

Answered
Help me to find nearest latitude and longitude between a bunch of latitudes and longitudes
You can do it like this dist = sqrt((coordinates.lon - coordinates.lon').^2 + (coordinates.lat - coordinates.lat').^2); dist(d...

27 days ago | 0

| accepted

Answered
How to properly position multiple plots within app-designer
In the Design view, drop a Panel in the position you want to place the tiledlayout. You will have to create in code. Click code...

27 days ago | 0

| accepted

Answered
Keep existing subplots while running code multiple times
You can change your code as follows. fOp.figName='my_title'; hf = findobj('Type','figure','Name',fOp.figName); if ~isempty(h...

27 days ago | 0

| accepted

Answered
How to divide a distance into some equal parts?
Assuming the coordinates are variable p1, p2 % p1 = [x1 y1]; % p2 = [x2 y2]; midpoint = p1 + 0.5.* (p2-p1); % halfway point ...

28 days ago | 1

Answered
How to extract confusion-matrix from confusion-chart?
You need to use the function confusionmat actual = t; predicted = y; mat = confusionmat(actual,predicted);

30 days ago | 0

Answered
data grouping (like pivot table in excel)
You can use the groupsummary function to summarize your data. %data = yourdata out = groupsummary(data,{'Date' 'event_type'});...

30 days ago | 0

| accepted

Load more