Respondida
looping based on filename-length
You can use strsplit to split the file name in the chunks, as they seem to be delimited by points. Then you can select the appro...

casi 6 años hace | 0

| aceptada

Respondida
matlab standalone does NOT exit when run in Windows cmd
That documentation seems strange to me from a Windows standpoint. Unless you spawn a process by using the batch command start a ...

casi 6 años hace | 0

Respondida
Modify a text file
You can get my readfile function from the FEX or through the AddOn-manager (R2017a or later). data=readfile(filename); HeaderL...

casi 6 años hace | 1

| aceptada

Respondida
Filling a matrix using vectorization
The problem is that this: A([1 2],[1 3]) returns 4 positions, not two. If you want two instead, you will need to convert subin...

casi 6 años hace | 2

| aceptada

Respondida
State button callback- break while loop?
In general the solution to this is to use a flag that is controlled by your button. Then inside the while loop you check for tha...

casi 6 años hace | 0

| aceptada

Respondida
Store values generate in a function call in an array
Instead of using a cell array, you can also use a 3D matrix: [~,~,~,spheresXYZ]=createspheres(0,0,0);spheresXYZ(1,1,SizeXYZ)=0;...

casi 6 años hace | 0

Respondida
Look for minimum value in array
Loops aren't slow. You generally only need to remove them if there are native functions that accept array inputs, which happens ...

casi 6 años hace | 0

| aceptada

Respondida
How to create randomly distributed triangles
Slightly editing your code gets me to a max framerate of just under 200. Results will vary for different systems. w = 3 ; ar=0...

casi 6 años hace | 0

| aceptada

Respondida
请问学生版的matlab可以在两台不同的电脑上安装吗?
Yes, but you have two buy two licenses. Technically it is possible to deactivate the license on one computer and activate it on...

casi 6 años hace | 2

Respondida
i am trying to find an x value when my y value is equal to 0
The chance that you end up with a value that is exactly 0 is quite small. You can use code like below as an alternative. [~,idx...

casi 6 años hace | 0

Respondida
system function cmdout has ' to the end
That is not an additional apostrophe. Your char array has a newline character at the end. So that apostrophe is not part of the ...

casi 6 años hace | 0

Respondida
Create a 2d matrix with two nested cycle
Dynamically growing arrays is a bad idea. You should probably provide more details about your actual goal, because this problem ...

casi 6 años hace | 0

| aceptada

Respondida
array exceeds maximum array size preference (when summing)
Use squeeze around the two terms you want to sum. The dimensions are different, so your current code attempts to use dynamic exp...

casi 6 años hace | 0

Respondida
Can MATLAB only be downloaded on one computer?
That depends on your license. I have understood that some home licenses will allow you to have Matlab activated on up to three c...

casi 6 años hace | 0

Respondida
How to extract numeric matrix from this file .out
doc readmatrix see the 'NumHeaderLines' option and the 'Delimiter' option.

casi 6 años hace | 0

| aceptada

Respondida
Using FORTRAN code in MATLAB
You can compile Fortran code to mex, after which you can use it in Matlab as a function. Read the documentation for the API deta...

casi 6 años hace | 0

| aceptada

Respondida
For Cody challenges, should the best solutions be based on the least number of characters used in one's code?
My personal opinion: no. I would favor a different metric: time. If you go for character count, that will only drive the use of...

casi 6 años hace | 2

Respondida
How to calculate intensity mean of certaian coordinates of an 3d CT dicom image when radius is given
SE=ones(10,10,2); SE=SE/sum(SE(:)); averaged=convn(IM,SE,'same'); averaged(x,y,z)

casi 6 años hace | 0

Respondida
A guide to flag or close questions
Only flag a comment/question when: it requires attention from staff members it should be deleted/closed, but you don't have su...

casi 6 años hace | 0

Respondida
For loop with random value to select from an array
If you only want a single value from your array I would suggest this code: clearvars; clc y=[1 5 4 3 2]; for i=1:8 ne...

casi 6 años hace | 0

| aceptada

Respondida
help with matrix addition and for loops
There are several issues with your code (not in any particular order): Your error message can't be reached, because that if is ...

casi 6 años hace | 0

Respondida
Finding the number of rows to the next row containing a 1
It took some time, but here is a solution that should also work for large matrices. clc,clear format compact A = [0 0 0 1 0 1...

casi 6 años hace | 2

| aceptada

Respondida
Function output wrong size
I don't understand why you would store the result val_2 in multiple positions, instead of only in i,j. Another thing I don't un...

casi 6 años hace | 0

| aceptada

Respondida
How to use isfinite() to mark if entry of cell array is {0×0 double}
Why don't you want to use the isempty option in cellfun instead? out=1-cellfun('isempty',gaitpar);

casi 6 años hace | 0

| aceptada

Respondida
Tricky randomization issue - help needed!
Because we now have a proper definition of the problem we can start writing the code for the solution: rng(1)%set a random seed...

casi 6 años hace | 0

| aceptada

Respondida
trying to have two figures on the same screen?
figure(9) subplot(2,2,[1 3]) %your fig 7 code subplot(2,2,2) %fig8 sub1 subplot(2,2,4) %fig8 sub2

casi 6 años hace | 1

| aceptada

Respondida
Why while end error does not work in my code??
Based on your now deleted comment ("Yeah, when i put semicolons it worked."): The cause of the loop seeming to be stuck is that...

casi 6 años hace | 0

| aceptada

Respondida
How to read the text file start from 7th line and convert the date into datenum?
Assuming each line is a cell: %01-Jan-1993 00:00:00 % 11111111112 %12345678901234567890 % date ...

casi 6 años hace | 1

| aceptada

Respondida
How to split text files into many text files?
The code below assumes each file ends with an empty line. You could also search for 'Lat:' instead to determine the beginning of...

casi 6 años hace | 0

| aceptada

Respondida
Error when using 'Run Section'
Remove the randi function here from your path: C:\Users\maris\Desktop\Bachelor Thesis\mvgc_v1.0\mvgc_v1.0\utils\legacy\randi\ra...

casi 6 años hace | 1

| aceptada

Cargar más