Answered
matrix dimension reshape error
i had expected to have dimension error in line 6 but it did not I would expect an error if the if condition is true when n <= 2...

6 years ago | 0

Solved


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

6 years ago

Answered
Best way to create a matrix of points?
A=[-5 -4.5 1.5 2; -5 -4.5 2 2.5; -5 -4.5 2.5 3; -4.5 -4 1.5 2; -4.5 -4 2 2.5; -4.5 -4 2.5 3]; points = unique([A(:, [1, 3]); ...

6 years ago | 1

| accepted

Answered
Regarding matlab cody solutions
Once you solve a problem, you can see other solutions of the same size or larger. You won't be able to see smaller solutions unt...

6 years ago | 2

Answered
How to reshape the columns of a matrix into one row?
It's not clear what it is you want as an output. If it's a row vector, there's no concatenation involved, you just simply reshap...

6 years ago | 1

| accepted

Answered
Hello. How much does support about license Matlab Version 9.5 (R2018b) cost for year?
Contact Mathworks sales for this. The cost is going to depend on the type of license you have, on which toolboxes you have and w...

6 years ago | 1

Answered
Speed up calculation of normal vectors metric
Why do you remove the current point from the search set. Doing that means copying the whole point matrix (bar one point) for eac...

6 years ago | 0

Answered
Copy an Excel worksheet from one workbook to another with Matlab
You may as well write a macro in excel because you'd be using the same code in matlab: excel = actxserver('Excel.Application');...

6 years ago | 1

| accepted

Answered
How can I get filenames for individual images in a multi-page tiff stack?
Probably with: filepath = 'C:\somewhere\somefile.tiff' infos = imfinfo(filepath); %should return a Px1 structure where P is t...

6 years ago | 0

Answered
Using cellfun with function that can return nothing
I'm not going to comment on the wisdom of using evalin. The problem is not with cellfun. You'll get the same error if you do: ...

6 years ago | 0

| accepted

Answered
Split values for a time-frame to every 15 minutes
This should work. First a function to operate on each row of your table: function spreadtable = spreadvolume(dstart, dend, vol...

6 years ago | 1

| accepted

Answered
Indirectly addressing a tall datastore -- MATLAB Golf
Is your FIELD column imported as a string array (as opposed to cellstr)? As a cellstr the == 'BN_SURVEY...' wouldn't work, you'd...

6 years ago | 0

Answered
anyway to cat specific column using horzcat?
As others have said, no you can't do that with a single statement. Assuming a cell array of any shape and size, rik's suggestio...

6 years ago | 0

Answered
C Mex File - Pass an Int into it
All the mxGetInt**s functions requires that you use the Interleaved Complex API which you enable with the -r2018a switch to mex....

6 years ago | 1

Answered
Generating long string with 0 (probability of 0.5) and 1 (probability of 0.5) with space in between two adjacent characters
One way: num01 = 1e5; %how many 0 and 1 you want in total strjoin(string(randi([0 1], 1, num01)), " ")

6 years ago | 0

Answered
NI-Scope Documentation
The relevant documentation comes from National Instrument, not Mathworks. The driver manual should have been installed when you ...

6 years ago | 0

| accepted

Answered
Output score which is nearest to image date
The second output table is easy: %demo data: source_table = table([4270;4999], datetime({'17/11/2011';'02/04/2014'}, 'InputFor...

6 years ago | 1

| accepted

Answered
how to create an index that keep tracking the hours in the data
Here's how I'd do it: %twomonth: a Nx3 matrix, whose first column is hour, 2nd is price, 3rd is demand bin = discretize(mod(tw...

6 years ago | 2

| accepted

Answered
Code is running continuously, but never ends
As others have said, you need to debug the code you've written, using the various tools that matlab offer. waitbar is one, you c...

6 years ago | 0

Answered
Replace row of matrix with vector by logical indexing
a = 101:120; %a should really be a column vector to start with, if it's meant to work along the rows of b b = reshape(1:100, 20...

6 years ago | 0

Answered
how to fread not a file, but a vector that equals fread a file in binary form?
There is not fread(fileid, 'r'), there is a fopen(filename, 'r') but that tells us nothing about how you read the file initially...

6 years ago | 0

| accepted

Answered
recode the missing values equal to the preceding recorded value
The easiest way is to use fillmissing with the appropriate option, after having replaced the -999 by NaN.

6 years ago | 0

Answered
How to remove letters from cell arrays
Don't use the ancient datestr or datevec particularly for dates as you have that are timezoned since these don't support time zo...

6 years ago | 0

Answered
Call specific rows of a table then choose rows that has specific criteria in those rows .
I want to say for each radius celltracker_group2.time == 10 if radius<=3 and cell_type==4 then GroupCount=GroupCoutn+1 Easily d...

6 years ago | 0

| accepted

Answered
Using for loop for arrays
Not sure what is wrong You'll always going to get min(74, numel(a)) as a count, since you're comparing the index i instead of t...

6 years ago | 0

| accepted

Answered
Vectorizing nested for loops
I am generating hundreds to thousands of particles That's not many, it's only when you get in the order of a hundred thousand t...

6 years ago | 1

Answered
Target just the last added entries to a matrix
As commented: A(end-n:end, :) will give you the last n+1 rows of the (2D) matrix. does your solution only work with a loop W...

6 years ago | 0

| accepted

Answered
how to generate a matrix with all possible combinations in an efficient way
For reasonable n and m you can either use Jos' allcomb or the following: %n: a vector of numbers %m: a scalar integer allcomb...

6 years ago | 0

Answered
Creating a script with if statements
In matlab, if statements should be your last resort. By necessity if statements apply to scalars so they tend to force you to us...

6 years ago | 0

| accepted

Answered
How to calculate the average gradient of an image?
Missing from your equation, is the exact definition of G. You're currently using the sobel operator to compute the gradient and ...

6 years ago | 1

Load more