답변 있음
Hello everyone.How to modify the judgment code below and add'This is correct' and'This is wrong'?
As mlint is already warning you: 0.125<lamda1<3 is not doing what you think it does. Use this instead: if 0.125<lamda1 && lambd...

5년 초과 전 | 0

답변 있음
How can i plot it
You have two surfaces: theta = linspace(0,2*pi,30); phi = linspace(0,pi/2,30); [theta,phi] = meshgrid(theta,phi); r = 3; ...

5년 초과 전 | 0

| 수락됨

답변 있음
How to get data from a website
I can't tell you what you did wrong, because you decided not to post what you have tried. That meant I had to write your code fr...

5년 초과 전 | 0

| 수락됨

답변 있음
Build a relay on code
You should sketch the two behaviors (don't use i or j as a variable name, and use comments to describe what your code is doing):...

5년 초과 전 | 0

| 수락됨

답변 있음
How to randomly select sub-sets from an array?
Read your data to a Matlab variable (even load might work here). Generate a vector of 1000 integers between 1 and 51360-48. The...

5년 초과 전 | 0

답변 있음
Why is extractFileText Much Slower than fileread for Text Files?
fileread is very basic. It will often not work for files that are encoded with UTF-8 and can only handle plain text files. That ...

5년 초과 전 | 0

| 수락됨

답변 있음
WebAPP Server 2020b File download using uiputfile
The uiputfile returns a full path as the second output, see the documentation. You can test if the path it returns fits within y...

5년 초과 전 | 0

답변 있음
R code to MatLab?
The consensus seems to be that you should invoke R from the command line. You can use the RunRcode FEX submission.

5년 초과 전 | 0

답변 있음
How can I add a legend in a for loop?
The best way is probably to use the DisplayName input for plot. You would have to be a bit careful about the order in which your...

5년 초과 전 | 0

| 수락됨

답변 있음
Change multiple push buttons with one push button?
You can make the shift callback change a flag. That flag should be stored in the guidata struct. In the other callbacks you can ...

5년 초과 전 | 1

| 수락됨

답변 있음
Implement double summation in Matlab
The sigma symbol contains all syntactic elements that you need for a for loop: y=0;%initialize to 0 for j=1:N for i=1:j...

5년 초과 전 | 0

답변 있음
Replace values in a matrix
Because you are only using integers, you can even use indexing to do the replacement: A=[NaN NaN NaN 3 3 3 2 NaN...

5년 초과 전 | 0

| 수락됨

답변 있음
Save workspace with same load file name
You can use code like this in a loop. file_name_including_dot_txt='example.txt'; data=function_that_reads_your_file(file_name_...

5년 초과 전 | 2

| 수락됨

답변 있음
define end of line (eol) as unix (\n) not Windows (\r\n) using writecell
You can hack a solution together: Write the file with CRLF with writecell Read the file as a text file (e.g. with readfile or ...

5년 초과 전 | 1

답변 있음
fopen files in one dataset
You don't use either filename when calling fopen. How is Matlab supposed to know which file you mean? I would suggest using eit...

5년 초과 전 | 0

| 수락됨

답변 있음
Iterating through a structure
You can index a struct in a loop: rx = no_afr_stru(n).X(1:end-1); ry = no_afr_stru(n).Y(1:end-1);

5년 초과 전 | 0

| 수락됨

답변 있음
Randomized array with limits
A=1:3;A(4)=randi(3); mp=A(randperm(end))

5년 초과 전 | 0

답변 있음
Converting data from two cell arrays in one vector
Je zou je klasgenoot kunnen vragen, ik heb gisteren bijna de zelfde vraag beantwoord: link. Continuing in English: that shoul...

5년 초과 전 | 0

답변 있음
Sort categorical variables in an alphabetical order
As Ive Ive suggested: the sort function will do what you need: B = categorical({'NY','Boston'}); sort(B)

5년 초과 전 | 0

| 수락됨

답변 있음
A neat reliable way to add up section of a matrix
Loops tend to do the trick: A = repmat(1:10,10,1); B = repmat(1:8,10,1); C = repmat(1:6,10,1); D = repmat(1:4,10,1); E = re...

5년 초과 전 | 1

| 수락됨

답변 있음
Take maximum of different cell arrays in cell array
In each cell there is a double, and some elements are empty. You can either use a loop or use cellfun. B=cellfun(@max,d...

5년 초과 전 | 0

| 수락됨

답변 있음
Read a list of filenames in a text file
If you are using R2020b you can use the readlines function to read the content of a file to a string array. You can also get the...

5년 초과 전 | 1

| 수락됨

답변 있음
Warning: Name is nonexistent or not a directory error
I have seen the suggestion to use the 'set path' window to remove the temporary folder from the path. That worked for me. In th...

5년 초과 전 | 1

| 수락됨

답변 있음
how to speed up basic image processing tasks
Most basic tasks can be vectorized. But for your code there is something that makes an even larger difference: you don't have a ...

5년 초과 전 | 1

| 수락됨

답변 있음
how to solve (5x1) matrix?
I believe I can mimic the shortest answer I have seen on this forum: \ To give this answer a bit more substance: you need to...

5년 초과 전 | 0

| 수락됨

답변 있음
How to change figure properties for all figures in MATLAB?
set(groot,'defaultFigureCreateFcn',@(fig,~)SomeFunction(fig))

5년 초과 전 | 0

답변 있음
How to read greek characters in a .txt file
You can get my readfile function from the FEX. If you are using R2017a or later, you can also get it through the AddOn-manager.

5년 초과 전 | 0

답변 있음
MATLAB taking too much memory on SD card
I'm guessing you have a fairly large sector size on your SD card. Most file systems store files in sections called sectors. If ...

5년 초과 전 | 0

| 수락됨

답변 있음
end indexing function as method input
If you create a dummy property (which is only used so Matlab treats your method as a property), you can use the overloaded subsr...

5년 초과 전 | 0

| 수락됨

답변 있음
Error in hand written code
I personally prefer not to use load for text files, as it isn't obvious from the context that the specific text file will actual...

5년 초과 전 | 0

더 보기