Answered
Displaying empty array as output
Hopefully, your real code doesn't use the same indentation as what you've posted above. If it does, I suggest that you let matla...

7 years ago | 0

Answered
Choice of Database for smooth data import into Matlab
While excel can be used as a data source, I would hardly call it a database. Particularly, if you compare it to SQL databases. T...

7 years ago | 0

| accepted

Answered
splitting data in a table when ever the cell is empty
Matrices can never have empty rows. What you call empty rows are rows with 0s in both columns. If I understood correctly what ...

7 years ago | 0

| accepted

Answered
How to align multiple matrices based on the first column values?
The simplest way is convert your matrices to a table, which may make sense anyway considering that it looks like the columns of ...

7 years ago | 0

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 101)
My guess is that you want all the times, in which case: newsst = sst(newlat, newlon, :); Using time as an index into newsst ma...

7 years ago | 0

Answered
Find the closest value in each group in a matrix column
Within splitapply, when min is invoked, it's invoked on a single group. Therefore, the index it returns refers to the index of t...

7 years ago | 0

| accepted

Answered
Tab completion of struct within cell
The reason why tab completion doesn't work for the content of a cell array can easily be explained: matlab does not look into th...

7 years ago | 1

| accepted

Answered
Bypass uigetdir in function
The proper way to go about this is to separate the processing code into a function, completely independent of user input/output....

7 years ago | 1

| accepted

Answered
"matlab drive" remove space in filename
When you install the connector, you can choose the path of the folder, at least on Windows. I would assume the same is true for ...

7 years ago | 1

Answered
Select groups of data with a specific size
Simply build the histogram of your groups (with histcounts or accumarray) and select the groups you want to keep with ismember: ...

7 years ago | 0

| accepted

Answered
Given an instance of a class (without knowing class name), how to call the constructor?
As Sean said, you may want to inherit from matlab.mixin.Copyable instead of implementing your own cloning interface. However, t...

7 years ago | 1

Answered
Polyfit function - NaN
polyfit cannot cope with missing data.So, if you want to use polyfit you have but no choice to remove that missing data. If the...

7 years ago | 0

Answered
Importing data from a file in a specific way
The numbers in your text file have less precision than matlab uses. So, the simplest thing is to load them with csvread (or dlmr...

7 years ago | 0

Answered
How can I extract and then write data in certain order from other excel files to excel file?
[~, sheets] = xlsfinfo('Data.xlsx'); %get list of sheets lattables = cell(size(sheets)); %preallocate cell array of table...

7 years ago | 0

| accepted

Answered
problem for brace in array name
Clearly, if each cell is empty, that's because no file is found. Perhaps you build your path wrong, or perhaps there is no file ...

7 years ago | 0

| accepted

Answered
Why is Matlab crashing during this program?
Matlab actually crashing (i.e. the application terminates) should not happen. Perhaps you run out of memory? Matlab actually st...

7 years ago | 0

| accepted

Answered
Read to dataframe then get row whose column equals to value
It probably is just as easy in matlab: df = readtable('text.txt', 'TextType', 'string'); data = df(df.video_id == "video_0001"...

7 years ago | 1

| accepted

Answered
how to run a Macro from excel in MATLAB
It's going to be something like: excel = actxserver('Excel.Application'); excel.Workbooks.Open('C:\somewhere\someexcelfilewith...

7 years ago | 0

Answered
Comparing two tables and copy elements of table 2 into table 1
%create demo tables ID = strsplit('hello new world hi hello hi')'; T = cell(6, 1); W = T; V = [1; 2; 3; 5; 8; 7]; T1 = tab...

7 years ago | 1

| accepted

Answered
How can I measure the temperature of each pixel?
You can't. Your thermography image is not the raw image from the sensor. It's a processed image that associate false colour to t...

7 years ago | 0

Answered
Scatter plot with extra features
halflength = 2; scatter(data(:, 1), data(:, 2), 'MarkerEdgeColor', 'b', 'MarkerFaceColor', 'r') for row = 1:size(data, 1) ...

7 years ago | 0

| accepted

Answered
How can I speed up this loop (or avoid using it)?
%your original start, we don't need the first 3 outputs [~, ~, ~, binz, binx]=histcounts2(zposn2,xposn2,NBINS,'YBinLimits',[xmi...

7 years ago | 0

| accepted

Answered
How can I randomly pick a row (A) from a matrix give the same value from array (B)?
If I understood correctly: [~, ~, uid] = unique(B); %If B is an array of integers from 1 with no gaps, then uid will be the sa...

7 years ago | 0

| accepted

Answered
import and sorting text file to matlab
Import all the text files folder = 'c:\somewhere\somefolder'; filelist = {'fileA', 'fileB', ...}; %obtained however you want....

7 years ago | 1

| accepted

Answered
Sorting a 64 x6 table
If I understood correctly what you want, you basically want a plot for each unique y value which are the other variables against...

7 years ago | 0

Answered
For loop in function doesn't work, but does work outside of it.
Nothing is ever random on a computer. Your description is not entirely clear. If I got it wrong, then attach your m file so we ...

7 years ago | 1

Answered
Question involving nested 'for loops' pertaining to structs and cell arrays
First a few comments about your code: I'd recommend you use sprintf rather than strcat + num2str, so: t_x{n}.video = sprintf('...

7 years ago | 1

| accepted

Answered
count white pixels on each column of a binary image
It's puzzling why you can't modify your code: counts = sum(topHalf, 1); %all you need to change is the ,2 into ,1 to sum along...

7 years ago | 0

| accepted

Answered
Convert hourly to daily data
Because of the typos and the lack of comments, it's hard to tell how your data is stored. The simplest way to achieve what you w...

7 years ago | 2

Answered
How do I load data files starting wih strings?
I'm not sure what you call ASCII files. Perhaps you meant text file. ASCII is a particular text encoding (which only allows 127 ...

7 years ago | 1

| accepted

Load more