Respondida
you are designing a rectangular page to contain 60 inch^2 of printing with a 4-inch marging at the top bottom and a 2-inch margin at each side.what overall dimensions will minimize the amount of paper used?
While this is valid matlab: 1 == (60/(b-4)) + 8; it doesn't do much. Without the semicolon at the end, it would just display w...

casi 7 años hace | 0

Respondida
Fibonacci sequence up to first 256 elements
See Loren's blog for an efficient way to compute the fibonacci sequence using filter. As for your question, % Calculating firs...

casi 7 años hace | 0

Respondida
How to use map and reduce efficiently?
Assuming your shares variable is numeric and assuming your grouping variables are {'rdate', 'cusip'}, t = tall(ds); [group, r...

casi 7 años hace | 2

| aceptada

Respondida
Creating a Matrix from Distances between Vectors
This can be achieved easily without a loop: %demo data m = 46 n = 100 A = rand(3,m) B = rand(3,n) distance = sqrt(sum((p...

casi 7 años hace | 0

| aceptada

Respondida
Group maths on for loop
The vectorised version of what you intended with your loop (but didn't achieve): R=15; r=5; epsilon=100; delta=(R-r)*(epsilo...

casi 7 años hace | 0

Respondida
Save Function does not work
If you look at the error message #031 in the hdf save, you can clearly see the problem: #031: H5FDsec2.c line 822 in H5FD_sec...

casi 7 años hace | 1

| aceptada

Respondida
How can I convert table of chars to array of strings?
I imported the data from an excel sheet as categorical array. It was somewhat manual to work to create my table Yes, you made a...

casi 7 años hace | 5

| aceptada

Respondida
arrayfun isreal fails - how to fix?
Note that the problem you highlight has nothing to do with isreal. I guess that you've uncovered an unexpected implementation de...

casi 7 años hace | 2

Respondida
Some confusion in my script for lsqcurvefit
You know that (the badly named) P and L are both column vectors, then you have A=P; %how about using meaningful names fo...

casi 7 años hace | 1

| aceptada

Respondida
How to specify the type of the argument of the function?
If you're asking how to construct a BlockInfo object, with the current class definition, it has to be: block = BlockInfo; bloc...

casi 7 años hace | 0

Respondida
Can this be written in a much better way for fast computations?
If Joel hypothesis that "You want to look at each pixel which is mostly water, and assign a distance from the pixel to all surr...

casi 7 años hace | 3

Respondida
[Help] writetable text alignment and saving pre 0
Your question is not very clear. I'm not sure what you're referencing with it. Note that the numbers 0409, 0000000000409, 409.0...

casi 7 años hace | 1

| aceptada

Respondida
Error: Index in position 1 exceeds array bounds.
You've told xlsread to import from row 607 to 1947, therefore, you'll get a (1947-607+1 = 1341) x 2 array, where row 1 correspon...

casi 7 años hace | 0

Respondida
How to find out the image name of a randomly selected image and save it to workspace by PushButton?
The code you show doesn't appear to be related to a GUI, so it's unclear how it relates to your question. how does the image na...

casi 7 años hace | 0

| aceptada

Respondida
How can I find all object of a certain handle class?
I don't think there's any way to track down instances after the fact. You could however track the creation and deletion of all...

casi 7 años hace | 4

| aceptada

Respondida
Meshgrid function different order
Personally, I think meshgrid is an abomination as it doesn't really makes its mind what order the dimensions are in. It iterates...

casi 7 años hace | 1

Respondida
How to assign points to multiple polygons using inpolygon
There is no point iterating over each point and each polygon. You can pass all the points at once to inpolygon. Here's how I'd i...

casi 7 años hace | 1

| aceptada

Respondida
How to display images in APP DESIGNER?
If you want to display your image in a uiimage control, then simply assign the image to the ImageSource property of the control:...

casi 7 años hace | 1

| aceptada

Respondida
Tall array - How can I perform conditional search and extract information
It should be as simple as: highestprice = gather(groupsummary(tt, [1, 2], {'none', 'day'}, 'max', 5)) %you can replace 1, 2, a...

casi 7 años hace | 0

| aceptada

Respondida
help with basic 2048 game function
I'll be editing this answer as I read the code. ---edit: the main reason for your code not working is at the end of the answer....

casi 7 años hace | 1

| aceptada

Respondida
Attempting to find patterns within my data
%demo data: A = logical([ 0 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1]) Finding the start index (in the first column) of ...

casi 7 años hace | 0

Respondida
Save data from for loop without subscript index
%... constant definitions timesteps = t0:dt:t_stop; h = zeros(size(timesteps)); %preallocate h for step = 1:numel(timestep...

casi 7 años hace | 0

| aceptada

Respondida
Unable to read the last line by using regexp
As I said, your regular expression is invalid, and even corrected doesn't work very well. I also suspect that the (\r) was meant...

casi 7 años hace | 1

| aceptada

Respondida
How can I get the indices of values meeting a condition in a tall array?
Maybe find is not working on tall since I use 2017b Indeed, support for using find on tall arrays was added in R2018a. As for...

casi 7 años hace | 2

Respondida
A doubt regarding a simple For loop indexing for certain rows only.
Since nobody has explained why your code doesn't work: There are several problems with your if a(c, [1:4]) == [1, 2, 3, 4] | [...

casi 7 años hace | 1

| aceptada

Respondida
How to solve "Subscripted assignment dimension mismatch"?
Off by one error, 279:322 is 44 elements not 43. Same for all the other indices, you've got one more element than required. Any...

casi 7 años hace | 0

| aceptada

Respondida
Out of memory. The likely cause is an infinite recursion within the program.
You, or some code you've downloaded is shadowing the isrow.m function of matlab. Hopefully, the isrow.m you've deleted is not t...

casi 7 años hace | 1

| aceptada

Respondida
How to select a group of consecutive (yet excluding weekends and holidays) dates between a certain date A and a certain date B from datetime?
If I understood correctly, use the isbetween function: %bus_dates: a datetime vector of all business dates between 2012 and 201...

casi 7 años hace | 0

Respondida
Error using str2func Error: This statement is incomplete
So, instead of writing a program to solve a problem, you are writing a program that writes a program that solves a problem. As a...

casi 7 años hace | 1

| aceptada

Respondida
How can I apply ndgrid in loop?
It's not any clearer what you want, since you don't define what you mean by multiply and since ndgrid has nothing to do with mul...

casi 7 años hace | 0

| aceptada

Cargar más