Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 2

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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;...

fast 6 Jahre vor | 0

Beantwortet
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 ...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

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

fast 6 Jahre vor | 2

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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 ...

fast 6 Jahre vor | 0

Beantwortet
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 ...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 0

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

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 2

Beantwortet
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)

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 6 Jahre vor | 0

Beantwortet
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...

fast 6 Jahre vor | 2

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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);

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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

fast 6 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

fast 6 Jahre vor | 1

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 6 Jahre vor | 1

| akzeptiert

Mehr laden