similar to: stuff I used to do in Matlab

Displaying 20 results from an estimated 10000 matches similar to: "stuff I used to do in Matlab"

2001 Nov 29
3
pause/get input
Hi, Is there a simple command to pause a script until the user hits return? Alternatively, is there a command which prompts the user for some input and assigns the input into a variable? dave +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |David Richmond It works on a | + Dept. of Sociology complex scientific + |Saint Mary's College
2001 Oct 30
2
extracting object names as strings
Hi, I'm looking for a function which returns the name of the argument object as a string: >vect <- 1:3 >function(vect) "vect" I've looked at 'name', 'names', 'objects', none seem to do exactly what I want. ls/objects comes close, but I can't figure out how to force it to give me only one object name. daver
2006 Dec 22
2
Pb with R.matlab
Hello, I have problems running the R.matlab package. I work with R 2.3.1, under windows (using the Rgui). It seems that, even after loading the package, the "simple" functions such as writeMat() or readMat() are not recognized. For example, the following script leads to an error: > install.packages("R.matlab") --- Please select a CRAN mirror for use in this session ---
2001 Oct 09
3
find indices of nonzero elements
Hi, Is there a function func(x) where x is an array such that it returns a list of the indices of all non-zero elements of the array? for example: a: 1 0 0 0 0 1 0 1 0 func(a) returns two vectors r and c: r c 1 1 2 3 3 2 daver +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |David Richmond It works on a | + Dept. of Sociology complex scientific
2008 Feb 29
2
GUI developement / Matlab
Hi there, I was wondering whether there are flexible packages available with which you can create user interfaces? (I've read about "gWidgets"!?) For example in Matlab you can even create stand alone applications. Is it also possible for R in the same extend? Of course it should be platform independent if possible... And then I would like to know from people who know R as well
2008 Apr 30
8
Why R is 200 times slower than Matlab ?
I am switching from Matlab to R, but I found that R is 200 times slower than matlab. Since I am newbie to R, I must be missing some important programming tips. Please help me out on this. Here is the function: ## make the full pair-wise permutation of a vector ## input_fc=c(1,2,3); ## output_fc=( 1 1 1 2 2 2 3 3 3 1 2 3 1 2 3 1 2 3 ); grw_permute = function(input_fc){ fc_vector = input_fc
2002 Mar 20
7
how does while work
i am having some problems with a program that i am writing and i think that knowing how the while command works will help me to figure out where i am going wrong *when do you get kicked out of a while loop?* (i.e., in the following example what would the final value of 'a' be?) i thought it would be 99 but running it in R i get 101 (and 101 for x too!) while (x <100) { for (i in
2007 Oct 02
4
R routines vs. MATLAB/SPSS Routines
Hi all, I've become quite enamored of R lately, and have decided to try to teach some of its basics (reading in data, manipulation and classical stats analyses) to my fellow grad students at the University of Toronto. I sent out a mass email and have already received some positive responses. One student, however, wanted to know what differentiates the routines that R uses, from those
2001 Sep 28
3
evaluating the contents of a string
Hi, suppose I do: b <- matrix(1:9,3,3) bname <- "b" now dim(b) returns [1] 3 3 and dim(bname) returns NULL is there a function to pass bname to such that dim returns the dimensions of b? like dim(somefunc(bname)) returns [1] 3 3 does 'somefunc' exist? daver +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |David Richmond It
2010 Oct 11
1
MATLAB vrs. R
I need to find the area under a trapezoid for a research-related project. I was able to find the area under the trapezoid in MATLAB using the code: function [int] = myquadrature(f,a,b) % user-defined quadrature function % integrate data f from x=a to x=b assuming f is equally spaced over the interval % use type % determine number of data points npts = prod(size(f)); nint = npts -1; %number of
2024 Feb 27
2
converting MATLAB -> R | element-wise operation
Why anything but sweep? The fundamental data type in Matlab is a matrix... they don't have vectors, they have Nx1 matrices and 1xM matrices. Vectors don't have any concept of "row" vs. "column". Straight division is always elementwise with recycling as needed, and matrices are really vectors in row-major order: 1 2 3 4 5 6 is really 1 4 2 5 3 6 and when you do
2007 Jul 03
2
vertically concatenating data frames
Hi, what is the recommended way to vertically concatenate 2 data frames with the same column names but different number of rows? My problem is something along these lines: df1 <- data.frame(var1=var1,var2=var2,var3=var3) # nrow(df1)=1000 df2 <- data.frame(var1=var4,var2=var5,var3=var6) # nrow(df2)=2000 I tried df <- c(df1,df2), no success. stack does not seem to be appropriate
2007 Apr 10
2
Matlab import
Dear R-Experts, here again a question concerning matlab. With the command "matrixM=[1 2 3;4 5 6]" a matrix under Matlab was constructed. It was than stored with the command "save('matrixM.txt','matrixM')". Now I tried to import the data in R with the help of the command "Z=matrix(scan("Z:/Software/R-Programme/matrixM.txt"))" An error
2001 Oct 16
4
Assignment of structures on a given environment
Hi, In order to avoid deep copies by passing large arguments to functions or returning values, I'm trying to do the assignment of variables in a given environment. The problem is when I try to assign a structure: a list for example. If I have: ind <- c("a","b") my idea is doing something like l <- alist() l[ind] <- as.list(c(20,40)) in a given
2006 Dec 20
1
R.matlab question
Does anyone know how to solve this question about R.matlab? I am in windowsXP, my matlab is matlab 7.0.0 19920(R14) thanks, Aimin > matlab <- Matlab(host="localhost", port=9998) > if (!open(matlab)) throw("Matlab server is not running: waited 30 seconds.") Error in list("throw("Matlab server is not running: waited 30 seconds.")" =
2006 Dec 17
1
Start Matlab server in R 2.4.0
In order to start matlab server in R , I using the following commands getwd() setwd("D:\R_matlab") install.packages("R.oo") install.packages("R.matlab") install.packages("R.utils") library(R.matlab) Matlab$startServer() a minimized MATLAB Command Window come out, but I can't make this window become larger. Does anyone know why? I type
2006 Dec 30
2
Evaluating Entire Matlab code at a time
Hi. On 12/30/06, Bhanu Kalyan.K <kalyansikha at yahoo.com> wrote: > Dear Mr.Bengtsson, > > The steps you have suggested are working for single lines of matlab > statements. But, as i mentioned earlier, If i want to see the output of an > entire matlab code (say swissroll.m) then you suggested me to do > res <- evaluate(matlab, "swissroll"). > When i did
2007 Nov 17
3
R and reading matlab compressed files
Is there any way to read these files (standard .mat files, created by matlab version 7 onwards are compressed)? I know that R.matlab doesn't read them (it even says in the file MatlabServer.m "Matlab v7 saves compressed files, which is not recognized by R.matlab's readMat()" (lines 47-8)). I know I should be able to make R call Matlab and transfer data (not that I managed to
2008 Jun 19
2
Comparison between R and MATLAB
Hi R, Can I get a comparison between R and MATLAB? How is R efficient than MATLAB? Or what are the weaknesses of R compared to MATLAB? Thank you very much for your help, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com This e-mail may contain confidential and/or
2003 Apr 03
2
Matrix eigenvectors in R and MatLab
Dear R-listers Is there anyone who knows why I get different eigenvectors when I run MatLab and R? I run both programs in Windows Me. Can I make R to produce the same vectors as MatLab? #R Matrix PA9900<-c(11/24 ,10/53 ,0/1 ,0/1 ,29/43 ,1/24 ,27/53 ,0/1 ,0/1 ,13/43 ,14/24 ,178/53 ,146/244 ,17/23 ,15/43 ,2/24 ,4/53 ,0/1 ,2/23 ,2/43 ,4/24 ,58/53 ,26/244 ,0/1 ,5/43) #R-syntax